首页 > 解决方案 > 具有行跨度的 td 中 css 类的奇怪行为(Angular)

问题描述

我正在使用一个名为“td-group”的自定义 css 类来自定义具有行跨度的 td,因为我使用的是 angular,所以更具体地说是 [attr.rowspan]。简而言之,css样式并不总是被正确应用,我到处寻找并尝试了一切,但仍然没有弄明白
错误只发生在chrome上,从不在边缘
这里是错误的图像

<tr *ngFor="let r of list; let i = index">
  <ng-container *ngIf="group && r.representative.show">
    <td class="td-group" [attr.rowspan]="r.representative.height">
      {{r.representative.name}}          
    </td>
  </ng-container>
  <td *ngFor="let c of cols">
    {{r[c.name]}}
  </td>
</tr>

Stackblitz https://stackblitz.com/edit/angular-yr3pxq?file=src/app/app.component.html

标签: cssangulartypescript

解决方案


推荐阅读