【发布时间】:2021-03-22 12:32:00
【问题描述】:
我有一个包含 1 个元素的列表,看起来像这样
我想在表格中显示数据,标题为作者姓名和标题。但是我的代码在一行上显示了所有标题,而不是为每个标题和作者姓名创建更多行。我怎样才能做到这一点?
Table I have with the following code
<table class='table table-striped' aria-labelledby="tableLabel" *ngIf="authorWithBooks">
<thead>
<tr>
<th>Author Name</th>
<th>Title</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let authorWithBook of authorWithBooks">
<td>{{ authorWithBook.authorName }}</td>
<td>{{ authorWithBook.bookNameList }}</td>
</tr>
</tbody>
</table>
【问题讨论】:
标签: c# html css angular html-table