在我的代码中,我使用了元素-UI表(https:/element.eleme.io#en-UScomponenttable。)组件。它工作得很好,但我想把表头自定义为粘性。
它提供了最大高度的内容,比如说。https:/element.eleme.io#en-UScomponenttable#table-with-fixed-columns-and-header。
但我想用它像。https:/codepen.iochriscoyierpenPrJdxb。
在CSS中,有一些关于它的技巧,比如。
th {
background: white;
position: sticky;
top: 0;
...
}
我在想,怎么才能实现呢?有没有什么建议?
我的案例是
<div css="first-section">
...
</div>
<div css="second-section">
...
</div>
<el-table>
...
</el-table>
例子是: https:/codepen.iosenolatacpenqBdGvRy。
要在全屏模式下查看。https:/codepen.iosenolatacfullqBdGvRy。