我有一张桌子,我想把头粘起来。
我使用以下代码:
.table-2 thead th {
position: sticky !important;
position: -webkit-sticky !important;
top: 0 !important;
}
.table-2 {
position: relative !important;
overflow-x: visible !important;
}在这个页面上:https://tfc.eu.com/smalley-spirolox-retaining-rings/spirolox-retaining-rings-selection-guide/
但这不管用。
怎么啦?
发布于 2022-04-07 13:34:42
据我所知:
这个问题归结为粘性需要位置的事实:相对于工作而言,这并不适用于CSS2.1规范。
(资料来源:https://css-tricks.com/position-sticky-and-table-headers/)
发布于 2022-04-07 13:43:44
首先,尝试将表标记在最后一组位置中的相对位置粘贴到th:
.table-2 {
position: relative;
overflow-x: visible;
}
.table-2 th {
position: sticky !important;
}你在每一张桌子上都只有这个,所以不需要头
https://stackoverflow.com/questions/71782720
复制相似问题