用于显示记录的表容器。我有一个要求,当表格到达屏幕顶部时,它的标题会粘在顶部。请指导我实现这个要求。
例如看这个链接 http://angular-data-grid.github.io/demo/fixed-header/angular-md-grid.html#!?page=1&itemsPerPage=75
谢谢, Java4you.
最佳答案
使用 Angular Material 表,将以下内容添加到包含组件的 .scss 文件中现在可以实现此目的,但不幸的是在 IE 中不能:
.mat-header-row {
position: sticky;
position: -webkit-sticky;
top: 0;
background-color: inherit;
}
参见 this供讨论。
关于javascript - 粘性标题 md-table-container Angular js Material 设计,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46468665/