Angular Material Table spitted headers add the sticky header functions

安稳与你 提交于 2021-01-07 06:57:06

问题


I am having the spitted header angular material table and I was looking for help to add the sticky header.

I have tried to using sticky: true but somehow it is not working for my first column (as I am hiding the column.) And for the first rows. It is showing the second row.

Below is my table

When I go with the dropdown only these headers get sticky behavior than others.

Below is my stackblitz.

https://stackblitz.com/edit/angular-bklajw-5foa62


回答1:


To make the top header sticky add sticky tag in that as well. It will also fixed first column sticky issue.

 <tr mat-header-row
     *matHeaderRowDef="['header-row-first-group','header-row-sec-group','header-row-third-group','header-row-forth-group','header-row-fifth-group'];sticky:true">
</tr>

Demo



来源:https://stackoverflow.com/questions/65430713/angular-material-table-spitted-headers-add-the-sticky-header-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!