【发布时间】:2019-03-03 17:28:10
【问题描述】:
在表格固定标题中,我需要所有文本都放在固定标题下,并且固定标题不要错位。这适用于第二个表中的所有内容。然而,第二张表中的所有内容都在 98% 的宽度内。
在第一个表中,我有一个 TD 标记,其中 white-space:nowrap 将所有内容保留在 1 行上,因此当溢出 x 发生时,固定标题变得未对齐。如何修复这个固定的表头以匹配表头而不是错位?
所以当 Overflow-X: Auto 发生时我需要它来工作。我想要水平滚动,这样就可以了,但是固定的标题会变得混乱。
您可能需要更改视点的大小才能看到这种情况发生
我认为可能是在 CSS 或 JQUERY 中我需要进行调整但不知道如何调整....
JSFIDDLEhttps://jsfiddle.net/rbla/1Ljuycbe/61/
.up:hover {
cursor:pointer;
}
.tooltip2 {
position: relative;
display: inline-block;
border-bottom: 3px dotted black; /* If you want dots under the hoverable text */
text-decoration: none;
color: #00F;
}
img.cadre {
border: 3px solid #D2D1D1;
border-radius: 4px;
width: 125px;
height: 125px;
}
.tooltip2 .tooltiptext2 {
visibility: hidden;
width: 130px;
background-color: #fff;
color: #fff;
text-align: center;
padding: 5px 5px;
border-radius: 6px;
margin-left: 7px;
position: absolute;
z-index: 0;
}
.tooltip2:hover .tooltiptext2 {
visibility: visible;
cursor:pointer;
}
.tooltip2 .tooltiptext2 {
top: -5px;
left: 105%;
}
/* Left Arrow */
.tooltip2 .tooltiptext2::after {
content: " ";
position: absolute;
top: 15px;
right: 100%; /* To the left of the tooltip */
margin-top: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent white transparent transparent;
}
table.blue.fixed {
z-index: 99;
}
【问题讨论】:
-
表格不遵循所有正常的 CSS 规则。
-
也许只使用一个普通的表格,位置:sticky on
th,根本不用javascript?