HTML CSS IE7表溢出问题

时间:2010-11-11 11:04:40

标签: html css

我有一张表,我指定的是一定的高度。我期待溢出,在Firefox上添加滚动,一切都很好。我的桌子下方有一个标签,如下所示。

在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 个答案:

答案 0 :(得分:1)

您需要从position: relative;元素中删除<tr>样式,并将overflow: auto;添加到包含<div>的样式中。这样就可以在Chrome,IE7和IE8上呈现。