【发布时间】:2022-03-31 03:57:26
【问题描述】:
如何使用 css 实现具有固定标题的水平和垂直滚动的表格?
我找到了这个Scrolling a div from an outer div,但它是通过使用 Javascript/Jquery 实现的。有什么方法可以只使用 CSS 来实现它?
更新后的代码:
#div-table-content {
width: 100%;
overflow-x: auto;
}
table {
font-size: 12px;
white-space:nowrap;
overflow-x: scroll;
}
tbody {
height: 400px;
overflow-y: auto;
width: 100%;
display: block;
}
thead tr {
display: block;
width: 100%;
}
【问题讨论】:
-
类似this?
标签: html css html-table