我有HTML表&它的CSS。html css tr设置宽度
CSS:
#outerDIV {
position: relative;
padding-top: 20px;
}
#innerDIV {
overflow-y: auto;
height: 500px;
}
table#mytable tbody tr:first-child
{
width:100%;
position :absolute;
}
HTML:
<div class="outerDIV">
<div class="innerDIV">
<table id="#mytable"></table>
</div>
</div>
我需要表的固定报头标记,所以是上述代码没有,但th标签的宽度被压缩到左&与身体的tr's
的宽度不匹配。如何使tr达到100%的宽度?
选中此链接(http://stackoverflow.com/q/16984323/1577396) –
提供的代码不正确。没有指定ID的表格。 –
已尝试删除'position:absolute'? – Bob