2010-11-11 75 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上呈现良好。