I want to loop my list in bootstrap columns.
- In the first row, I would like to show three columns
- In the second row, I would like to show two columns
- In the third row, I would like to show only one column
The code is below.
<div *ngFor="let watch of List;let i = index;" >
<div [ngClass]="{'col-xs-4 col-sm-4 col-md-4 col-lg-4': watch.rowtype == 'three-view', 'col-xs-6 col-sm-6 col-md-6 col-lg-6': watch.rowtype == 'two-view', 'col-xs-12 col-sm-12 col-md-12 col-lg-12': watch.rowtype == 'one-view'}"
style="text-align:center; background-color:rgb(0, 183, 255);">{{watch.name}}
</div>
<div>{{watch.value}}</div>
</div>
It is displaying each column in a single row. Not showing like three, two and one.