【发布时间】:2018-11-28 12:03:26
【问题描述】:
如何将此代码输出分成 4 个部分? 是否有可能使用 ngFor 并告诉它将数组分成批次并动态显示?
<h4>Reservation Slots</h4>
<table class="table table-bordered">
<tr *ngFor="let slots of reservationSlotsList" >
<td class="text-center">{{slots}}</td>
</tr>
</table>
我希望得到预期的输出
<table class="table table-bordered">
<tr>
<td class="text-center">my-slot1</td>
<td class="text-center">my-slot2</td>
<td class="text-center">my-slot3</td>
<td class="text-center">my-slot4</td>
</tr>
<tr>
<td class="text-center">my-slot1</td>
<td class="text-center">my-slot2</td>
<td class="text-center">my-slot3</td>
<td class="text-center">my-slot4</td>
</tr>
...
</table>
谢谢!
【问题讨论】: