如何将colSpan和行跨度添加到物料表Header Angular 7? [英] How colSpan and row Span added to material table Header Angular 7?

查看:104
本文介绍了如何将colSpan和行跨度添加到物料表Header Angular 7?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Angular material Table header 中添加 rowSpan and colSpan .谁能帮助我实现目标.

I'm trying to add rowSpan and colSpan in Angular material Table header. Can anyone help me to achieve it.

下面是我要使用物料表获取的附加标题

Below is the Attached Header I want to get using material table

推荐答案

我有像您一样的示例任务.我只是很容易用第二个标题不显示任何内容.

I have the sample task like you. I just easy to display none with second header.

  <ng-container matColumnDef="position">
    <th mat-header-cell *matHeaderCellDef [ngStyle]="{'display': 'none'}"> No. </th>
    <td mat-cell *matCellDef="let element"> {{element.position}} </td>
  </ng-container>

 <!-- first stage header -->
  <ng-container matColumnDef="No">
    <th mat-header-cell *matHeaderCellDef [attr.rowspan]="2">No</th>
  </ng-container>

这是我的结果

您可以点击我的链接了解更多信息: StackBlitz

You can follow my link to know more: StackBlitz

这篇关于如何将colSpan和行跨度添加到物料表Header Angular 7?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆