我正在try 显示该数组的数据,以显示具有两个子列的表标题.
我想实现的目标是: [![在此处输入图像描述][1]][1]
Array个
headerRows = [
{
id: 1,
column: 'A',
col1: 1,
col2: 2,
},
{
id: 2,
column: 'B',
col1: 1,
col2: 2,
},
{
id: 3,
column: 'C',
col1: 1,
col2: 2,
},
];
html个
<table>
<thead class="thead">
<tr>
<th class="text" rowspan = '2'>Text</th>
<th *ngFor="let headerCell of headerRows" colspan = 2>{{headerCell.column}}</th>
</tr>
<tr>
<td *ngFor="let cell of headerRows">{{cell.col1}} </td>
<th *ngFor="let cell of headerRows">{{cell.col2}}</th>
</tr>
</thead>
</table>