我正在修復表格的身高並使其滾動。基本上我有三張桌子,其中兩個我想在上面,並排排列,第三個應該在他們下面。 我想讓表體高度固定(比如300px),但我無法做出這種效果。我嘗試了各種方法,但其中大部分都是破壞桌面佈局的外觀。 這是我的代碼 -在tbody中設置表格的身高
<div id="DashboardTab" style="display: table-layout;">
<div style="display: inline-block; width: 100%;">
<div id="" style="float: left; width: 50%; ">
<legend>Planned</legend>
<table id="ePlanned"">
<thead>
<tr>
<th>Col1</th>
<th>Col2</th>
<th>Col3</th>
<th>Col4</th>
</tr>
</thead>
<tbody><!-- style="height: 300px; overflow: auto">--><!--tried this and other ways but not working-->
<tr>
<td>MX1</td>
<td>MX2</td>
<td>MX3</td>
<td>MX4</td>
</tr>
</tbody>
</table>
</div>
<div id="" style="float: right; width: 50%;">
<legend>Closed</legend>
<table id="eClosed" >
<thead>
<tr>
<th>Col1</th>
<th>Col2</th>
<th>Col3</th>
<th>Col4</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div id="" style="display: inline-block; width: 100%; overflow: auto;">
<legend>Stats</legend>
<table id="uStats" class="display" cellspacing="0" width="102.5%">
<thead>
<tr>
<th>Col1</th>
<th>Col2</th>
<th>Col3</th>
<th>Col4</th>
<th>Col5</th>
<th>Col6</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
,也是我取得了第3臺寬度102.5%,因此它被上面的兩個表對齊,但我知道它不是好的做法。 任何人都可以幫助我,我也浪費了很多時間。 我想讓我的頁面像下面的圖片一樣。
你把DIV到滾動塊,是不是我的目的基本上我只是想表格可以滾動。每次列屬性應該是可見的,這是不是你的情況 – RATHORE