本文介绍了如何使 mat-sidenav-container 内的表格标题具有粘性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里有一个解决方案如何使角度表标题具有粘性:如何制作角度带有粘性标题的表格粘贴到偏移量

I have a solution here how to make angular table header sticky:how to make angular table with sticky header stick to an offset

我的下一个问题是如何让它在 mat-sidenav-container 中粘住.将桌子包裹在 mat-sidenav-container 中不起作用:https://stackblitz.com/编辑/angular-h1utvg-zpqlsa?file=app%2Ftable-sticky-header-example.html

My next question is how to make it stick while inside 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 和 mat-sidenav 内容将位置设置为相对.我试过操作 position 属性无济于事.

I can see that mat-sidenav-container and mat-sidenav content set the position to relative. I've tried manipulating the position property to no avail.

推荐答案

我认为你应该用一些 container 包裹 table 并设置一些 max-height 到它.请参阅示例.

I think you should wrap table with some container and set some max-height to it. See example.

这篇关于如何使 mat-sidenav-container 内的表格标题具有粘性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 19:09