1
在Chrome和Firefox中,我有一個div內的表格,其滾動條可以正常工作。但是,當我在Internet Explorer 11中打開它時,發現div內的表佔用了屏幕的整個高度,並且滾動條不起作用。Container div在Internet Explorer 11中無法正確調整大小
我的div設置是這樣的:
<div id="wrapper">
<div class="main-body-full">
<div class="table-container">
<table>
<thead>
<tr>
<th rowspan="2">COLUMN 1</th>
<th rowspan="2">COLUMN 2</th>
<th rowspan="2">COLUMN 3</th>
</tr>
</thead>
<tbody id="drawingList">
/*Filled in with data*/
</tbody>
</table>
</div>
</div>
</div>
和相關的CSS我使用:
#wrapper{
/*height: calc(100% - 95px);*/
overflow-y: hidden;
}
form{
margin: 0;
height: 100px;
}
th, td{
overflow:hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.main-body-full table {
width: 100%;
height: 85%;
overflow-y: scroll;
}
/*Adding scrollbar to table body*/
.main-body-full tbody {
overflow-x: hidden;
width: 100%;
}
.table-container {
height:85%;
overflow-y: scroll;
}
An unsolved SO question has a jsFiddle showcasing the exact issue I'm having.
有什麼我錯過這裏?或者這是否需要不同的表結構?
絕對定位是我需要的!謝謝。 – Thassa
不客氣,高興地幫助:) – Pete