如何设置响应表主体的滚动

时间:2015-06-26 10:59:02

标签: html5 css-tables

我希望在表格中查看有限的记录,如果超出限制,则必须滚动并且thead应保持固定。

1 个答案:

答案 0 :(得分:0)

最后我得到了答案......

#custom-table th {
    text-align: left;
    width: 14.75%;
    border-bottom: 0;
}
#custom-table td {
    width: 15%;
}
#custom-table tr {
    display: block;
    width: 100%;
}
#custom-table tbody {
    display: block;
    height: 158px;
    overflow: auto;
}