您好,我遇到了粘性标头问题。我有三列,但最后一列,当我滚动时,数据决定与我的标题重叠。我不确定为什么要这么做。预先感谢!
我的CSS代码:
.Job-Report-Table {
position: relative;
display: flex;
border-bottom: 2px solid #414141;
max-height: 450px;
overflow-y: scroll;
thead th {
position: sticky;
top: 0;
}
.table {
.tableHeader {
font-size: 16px;
color: #414141;
// background-color: #d8d8d8;
.cell-1 {
background-color: #5b5b5b;
color: #ffffff;
vertical-align: middle;
}
.cell-2 {
vertical-align: middle;
background-color: #d8d8d8;
}
.cell-3 {
vertical-align: middle;
background-color: #d8d8d8;
}
}
}
答案 0 :(得分:1)
z-index
特权。
您应将z-index
上的thead th
设置为适当的(较高)值。如果没有指定其他z-index
值,则1就足够了。