I have a table that contains two nested iterations. The first three columns iterate through an array of objects (items), while the fourth column should iterate through an array of numbers (total=[30,70,100]
).
<table class="table">
<thead class="thead-dark">
<tr>
<th>Item</th>
<th>Unit Price</th>
<th>Quantity</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let i of item">
<td>{{i.product}}</td>
<td>{{i.price}}</td>
<td>{{i.quantity}}</td>
<ng-container *ngFor="let t of total">
<td>{{t}}</td>
</ng-container>
</tr>
</tbody>
</table>
The object array iterates correctly, but I am experiencing issues with the array of numbers (total=[30,70,100]
). I have tried placing the
(<ng-container *ngFor="let t of total">)
at different levels, however, it is not populating in the intended way. Any advice on how to resolve this issue would be greatly appreciated.