简体   繁体   English

如何使 mat-sidenav-container 内的表格标题具有粘性

[英]how to make table header inside mat-sidenav-container sticky

I have a solution here how to make angular table header sticky: how to make angular table with sticky header stick to an offset我在这里有一个解决方案如何使角表标题具有粘性: 如何使带有粘性标题的角表粘在偏移上

My next question is how to make it stick while inside mat-sidenav-container.我的下一个问题是如何让它在 mat-sidenav-container 内粘住。 Wrapping the table inside mat-sidenav-container doesn't work: https://stackblitz.com/edit/angular-h1utvg-zpqlsa?file=app%2Ftable-sticky-header-example.html将表格包裹在 mat-sidenav-container 中不起作用: https ://stackblitz.com/edit/angular-h1utvg-zpqlsa?file=app%2Ftable-sticky-header-example.html

I can see that mat-sidenav-container and mat-sidenav content set the position to relative.我可以看到 mat-sidenav-container 和 mat-sidenav 内容将位置设置为相对。 I've tried manipulating the position property to no avail.我试过操纵 position 属性无济于事。

I think you should wrap table with some container and set some max-height to it.我认为你应该用一些container包裹table并为其设置一些max-height See example .参见示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM