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

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

问题描述

我正在尝试在 Angular material Table header 中添加 rowSpan 和 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 和 row Span 如何添加到材料表 Header Angular 7?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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