0
我需要在固定佈局中放置一個表格並在可滾動容器中固定列寬。該表及其單列應占用colgroup部分中定義的空間。滾動容器中固定佈局的表格不消耗定義的寬度
這是HTML:
<div class="scroll-container">
<table>
<colgroup>
<col width="100px">
<col width="100px">
<col width="50px">
</colgroup>
<tr>
<td>width < 100px</td>
<td>width < 1 100px</td>
<td>width < 150px</td>
</tr>
</table>
</div>
而且這個CSS:
div.scroll-container{
width : 200px;
height : 90px;
background-color : #ddd;
overflow-x: scroll;
}
table{
table-layout: fixed;
}
td{
border : 1px solid black;
}
列的寬度被縮小,在div容器不滾動,而我要實現的對面。
的js小提琴:https://jsfiddle.net/n337p1ck/1/
很大,這很簡單:-)謝謝! – Paul