【发布时间】:2020-06-07 16:33:22
【问题描述】:
我在 Angular 中使用 Bootstrap 表时遇到问题:
我的<td> 标签不适合我的表头中相应的<th>:我不确定,是否是由于我调用模板呈现<td> 引起的:
这是我的代码:
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Students</th>
<th>Links</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let c of tests">
<app-preview-container id={{c.id}} name={{c.name}} description={{c.description}} studentCount={{Count[c.id]}}"></app-preview-container>
</tr>
</tbody>
</table>
这就是被调用的组件(<app-preview-container>):
<td>
{{name}}
</td>
<td>
{{description}}
</td>
<td>
{{count}}
</td>
<td>
some buttons
</td>
有没有人告诉我如何解决这个问题?我已经尝试了很多使用引导宽度参数,如 w-xx 或 col-md-x 或 col-x 或使用 scope="col"/"row"。但是这些都没有解决它。
【问题讨论】:
-
你能用演示数据创建stackblitz演示吗?
标签: html css angular bootstrap-4