我在一个 div (MainDiv) 旁边有三个表格,最大宽度:200 像素和最大高度:400 像素,而我的 BodyDiv 具有自动大小和最大高度:300 像素。
我需要(MainDiv)中的X方向滚动和BodyDiv的Y方向滚动。所以从 MainDiv 滚动我可以滚动所有三个表。
但它只显示了三列 BodyDiv 并在 200px 位置放置了一个滚动条。我在 BodyDiv 的末尾需要这个卷轴。
这是我的代码:
代码
<div id="MainDiv" style="max-width:200px;max-height: 400px;overflow-X: auto;overflow-Y: hidden;">
<table style="background-color:Fuchsia;width:100%;">
<tr >
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
</table>
<div id="BodyDiv" style="max-height: 300px;overflow-Y: visible;overflow-X: hidden;">
<table style="width:100%;">
<tr class="tr_even">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_odd">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_even">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_odd">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_even">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_odd">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_even">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_odd">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_even">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_odd">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_even">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_odd">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_even">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_odd">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_even">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_odd">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_even">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_odd">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
<tr class="tr_even">
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
</table>
</div>
<table style="background-color:Fuchsia;width:100%;">
<tr >
<td class="Cell">
column1
</td>
<td class="Cell">
column2
</td>
<td class="Cell">
column3
</td>
<td class="Cell">
column4
</td>
<td class="Cell">
column5
</td>
</tr>
</table>