我有一个表格,它使用角度为2的对象数组进行填充。现在,当对象数组为空时,除了表格标题单元格外,表格没有任何行。如何显示表为空且不显示表头行的消息?
<div>
<table class="table table-bordered table-hover fixed-header" >
<thead>
<tr>
<th>Event Name</th>
<th>Circle</th>
<th>Start Date</th>
<th>Start Time</th>
<th>End Date</th>
<th>End Time</th>
<th>Randomize</th>
<th>Priority</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let event of eventList">
<td>{{ event.id.eventId }}</td>
<td>{{ event.eventName }}</td>
<td>{{ event.circles }}</td>
<td>{{ event.startDate | date : "dd-MM-y" }}</td>
<td>{{ event.startTime }}</td>
<td>{{ event.endDate | date : "dd-MM-y" }}</td>
<td>{{ event.endTime }}</td>
<td>{{ event.randomize }}</td>
<td>{{ event.priority }}</td>
</tr>
</tbody>
</table>
</div>
答案 0 :(得分:1)