https://stackblitz.com/edit/angular-gevqvq?file=src%2Fapp%2Frow-span.component.css
分类合并的:
https://stackblitz.com/edit/angular-lnahlh?file=app%2Ftable-basic-example.ts
我要的:
https://stackoverflow.com/questions/53406725/dynamic-rowspan-in-angular?r=SearchResults
<table>
<ng-container *ngFor="let data of dataList">
<tr>
<td [attr.rowspan]="data.numbers.length">{{data.pname}}</td>
<td>{{data.numbers[0]}}</td>
</tr>
<ng-container *ngFor="let number of data.numbers; let i= index;">
<tr *ngIf="i!=0">
<td>{{number}}</td>
</tr>
</ng-container>
</ng-container>
</table>
网友评论