table tbody {
display:block;
height:500px;
overflow-y:scroll;
}
table thead, tbody tr {
display:table;
width:100%;
table-layout:fixed;
}
table thead {
display:block;
height:500px;
overflow-y:scroll;
}
table thead, tbody tr {
display:table;
width:100%;
table-layout:fixed;
}
table thead {
width: calc( 100% - 1em )
该方法可以实现一个table固定表头滚动,有一个缺点就是thead和tbody的th与td连接有点偏差,大概相差17px
解决这个办法可以使用thead和tbody各用一个table