【发布时间】:2018-06-23 04:19:36
【问题描述】:
我有一个包含表格的父组件模板
<table>
<thead>
<tr>
<th></th>
<th>Col 1</th>
<th>Col 2</th>
<th>Col 3</th>
<th>Col 4</th>
<th>Col 5</th>
<th>Col 6</th>
<th>Col 7</th>
</tr>
</thead>
<tbody>
<app-child-component [rows]="rows"></app-child-component>
</tbody>
</table>
子组件模板
<ng-template ngFor let-item let-i="index" [ngForOf]="row">
<tr>
<td>{{item.value1}}</td>
<td>{{item.value2}}</td>
<td>{{item.value3}}</td>
<td>{{item.value4}}</td>
<td>{{item.value5}}</td>
<td>{{item.value6}}</td>
<td>{{item.value7}}</td>
</tr>
</ng-template>
结果:
我的问题是如何显示为普通表格?
【问题讨论】:
标签: angular html-table angular2-template