HTML CSS IE7 表格溢出问题

标签 html css

我有一张 table ,我指定它有一定的高度。我期待溢出并且在 Firefox 上添加了一个滚动并且一切都很好。我的 table 下方有一个标签,显示在下方。

在 IE7 上,超出表格高度的行仍然可见。所以你可以想象 table 一直在超出它的高度尺寸。

我认为问题与溢出属性有关?我尝试了不同的 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>

最佳答案

您需要删除 position: relative;来自您的 <tr> 的样式元素,并添加 overflow: auto;包含 <div> 的样式.这随后在 Chrome、IE7 和 IE8 上呈现良好。

关于HTML CSS IE7 表格溢出问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4153729/

相关文章:

javascript - 在 javascript 函数中使用选择器 "$(this).find()"jQuery

html - Bootstrap 导航栏中的堆叠文本

html - 默认@media 查询样式

html - 我们如何从头开始以 Angular 创建模态弹出窗口

javascript - js canvas - 使用特定文本权重计算文本宽度

html - 将一个元素定位在 2 个其他元素之上

html - 如何将 Instagram 提要嵌入我的网站

javascript - 使用 jquery 将 div 移动到其他 div 上

php - 如何在 symfony/TextType/'label' 中使用 &lt;style&gt;

jquery - 如何将光滑的 slider 全宽居中?