AdelaM
AdelaM

Reputation: 78

Place 2 input fields on the same row when the number of input fields is not known

I am currently working on an angular application. I am using *ngFor to add input fields because the number of inputs is not always the same (it depends on the data received from backend). I there a way to make sure that 2 input fields are placed on the same row?

The html code looks like this

<div *ngFor="let content of group?.Content">
    <label>content.Title</label>
    <input type="text">     
</div>

Upvotes: 0

Views: 58

Answers (1)

Zouhair Ettouhami
Zouhair Ettouhami

Reputation: 226

You can use Bootsrap of Flex to Make sure 2 inputs take a row . Example:

<div *ngFor="let X of Xs">
 <input class='col-md-6' type="text" value='X'>     
</div>

Upvotes: 1

Related Questions