我正在使用bootstrap设计一个表,响应一个.直到它少了没有.列,这很好.使用固定标头,它工作正常.
现在,我在表格中需要超过20列,它也应该是水平滚动的.
我试图使它们一起工作,用于垂直滚动的固定标题表和具有可滚动标题的水平滚动.
我试过这个:
.table-fixed thead {
width: 97%;
}
.table-fixed tbody {
height: 150px;
overflow-y: auto;
width: 100%;
}
.table-fixed thead,
.table-fixed tbody,
.table-fixed tr,
.table-fixed td,
.table-fixed th {
display: block;
}
.table-fixed tbody td,
.table-fixed thead>tr>th {
float: left;
border-bottom-width: 0;
}
.table-fixed thead {
width: 97%;
}
.table-fixed tbody {
height: 230px;
overflow-y: auto;
width: 100%;
}
.table-fixed thead,
.table-fixed tbody,
.table-fixed tr,
.table-fixed td,
.table-fixed th {
display: block; …Run Code Online (Sandbox Code Playgroud)