2010-11-11 73 views
2

我有一個我指定的表是一定的高度。我期待溢出和Firefox上滾動添加,一切都很好。我的桌子下面有一張標籤,下面顯示。HTML CSS IE7表溢出問題

在IE7上,超出表格高度的行仍然可見。所以你可以想象桌子只是繼續超越它的高度尺寸。

我認爲問題是與溢出屬性有關?我嘗試了不同的W3,但它似乎沒有什麼區別?

<div style='height:285px;'> 
    <table id='search_results_originaltable' style='width: 390px;height:285px;'> 
    <thead> 
     <tr style='position: relative;display:block;'> 
     <th><div style='margin-left:15px;' /></th>  <th><div style='width:30px;color:orange;'>ID</div></th>  <th style='width:170px;color:orange;'>University</th>  <th style='width:50px;color:orange;'>PnL</th> <th style='width:40px;color:orange;'>Score</th> <th style='width:30px;color:orange;'>CV</th> 
     </tr> 
    </thead> 
    <tbody id='to_replace' style='overflow:hidden;height:200px;'> 
     <tr style='height:auto;position: relative;display:block;'> 
     <td style='width:15px;'><input type='checkbox' name='checkbox69' id='checkbox69' value='69'></td>  <td style='width:30px;color:rgb(22,87,136);'>69</td>  <td style='font-size:10px;width:170px;color:rgb(22,87,136);'>data</td>  <td style='width:50px;color:rgb(22,87,136);'>test</td> <td style='width:40px;color:rgb(22,87,136);'>test</td> <td style='width:40px;color:rgb(22,87,136);'><a href=javascript:ShowCV('70483') class='tab' style='width:30px;' label id='A6'>View</a></td> 
     </tr> 
    </tbody> 
    </table> 
</div> 
+1

'position:relative; display:block;'對於'tr'元素無效。不確定這是否是你的問題的原因,但它可能肯定會造成奇怪的行爲 – 2010-11-11 11:12:14

+0

它們是有效的值,但至少'display:block'在這種情況下是沒有意義的。 – RoToRa 2010-11-11 11:19:19

回答

1

您需要從<tr>元素刪除position: relative;造型,並添加overflow: auto;到含有<div>的風格。這在Chrome,IE7和IE8上呈現良好。