Angular 4渲染子选择器将列对齐分解到我的表中

时间:2018-06-15 15:26:03

标签: angular

我使用角度4作为我的应用程序,但我有角度选择器的问题。 我有一个带行子的组件表。 孩子的选择器名称是" row"。 我从表组件中调用它,如下所示:

<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表中,它会打破列对齐。

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

1 个答案:

答案 0 :(得分:0)

您可以使用colspan

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