1
是否有可能在自举来创建一个表:CSS引导固定报头
- 固定报头和滚动能够含量等here
- 的列需要大小proportionaly到各列的内容(较宽内容/小柱depanding)
- 涡旋能够x轴如果可以显示
- 列更多的列具有最小和最大宽度
到目前为止,我只找到了一个解决方案,需要通过类似here这样的弹性方法来知道正确设置大小的列数。
table {
box-sizing: border-box;
-moz-box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: stretch;
height: 500px; /* this can vary */
}
table * {
box-sizing: inherit;
-moz-box-sizing: inherit;
}
thead {
display: flex;
flex-direction: column;
align-items: stretch;
}
tbody {
overflow-y: scroll;
display: inline-block;
}
thead > tr, tbody > tr, tfoot > tr {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
thead, tfoot {
flex-shrink: 0;
}
th, tbody td {
width: 20%; /* this can vary */
overflow-x: hidden;
text-overflow: ellipsis;
display: inline-block;
}
tfoot {
display: inline-block;
}
tfoot td {
width: 100%;
display: inline-block;
}
好的,所以我和你有同样的问题。你必须建立一张桌子并包裹一张桌子。我将在下面发布示例 –