我正在研究角度的表格元素.Al通过我的代码工作得很好.但是,当我需要实现性能上的结合td属性,colspan其显示在下方浏览器控制台错误我:
Uncaught Error: Template parse errors:
Can't bind to 'colspan' since it isn't a known property of 'td'. ("Total Rows:
</td>
<td [ERROR ->]colspan="{{count}}">
{{rows}}
</td>
Run Code Online (Sandbox Code Playgroud)
我试过的是:
<table class="table table-hover" width="100%">
<tr>
<th *ngFor="let col of columns">
{{col}}
</th>
</tr>
<tr *ngFor="let data of getFilteredData">
<td *ngFor="let col of columns">
{{data[col]}}
</td>
</tr>
<tr>
<td colspan="{{count}}">
Total Rows: {{rows}}
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
我想要的是:
在我的.ts文件中,我给count列数组的长度值,所以列长度是我的页脚单元格使用属性绑定同样分布.
我也尝试:
但这些都没有奏效并显示出同样的错误.
| 归档时间: |
|
| 查看次数: |
9834 次 |
| 最近记录: |