首页 > 解决方案 > Angular 4 渲染子选择器将列对齐中断到我的表中

问题描述

我在我的应用程序中使用了 angular 4,但我遇到了角度选择器的问题。我有一个带有行子的组件表。孩子的选择器名称是“行”。我从表格组件中调用它,如下所示:

<table class="table table--striped">
 <thead class="thead--dark">
  <tr>
   <th>Data versamento</th>
   <th>Importo</th>
   <th>ABI</th>
   <th>CAB</th>
   <th></th>
  </tr>
 </thead>
 <tbody class="form--light">
  <row [data]="item" *ngFor="let item of enpals_payments"></row>
 </tbody>
</table>

将子选择器打印到 html 表中,它会破坏列对齐。

如何强制跳过行选择器渲染?

标签: angular

解决方案


您可以使用colspan

<tbody class="form--light">
  <tr>
    <td colspan="5"> 
      <row [data]="item" *ngFor="let item of enpals_payments"></row>
    </td>
  </tr>
 </tbody>

推荐阅读