IE表格单元格边框bug与colspan集

时间:2013-10-31 12:27:35

标签: html css

我有以下示例表:

<table>
    <thead>
        <tr>
            <th>t1</th>
            <th>t2</th>
            <th>t3</th>
            <th>t4</th>
            <th>t5</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td colspan="5">Colspan=5 here</td>
        </tr>
    </tbody>
</table>

这是简单的CSS代码:

table {
    border-collapse: collapse;
    border-spacing: 0;
}
th, td {
    border: 1px solid #000;
}

奇怪的是第一个th消失后的底部边框,这是一个截图:

IE cell border bug

当我切换到另一个窗口并切换回IE时,表刷新正常。为方便起见,我创建了一个jsFiddle:http://jsfiddle.net/hulufei/3dxt2/9/

此效果IE10,9,8。IE中是否有针对此错误的修复程序?

2 个答案:

答案 0 :(得分:3)

更改样式代码,因为这似乎可以解决问题:

table {
    border-collapse: collapse;
    border-spacing: 0;
    border-top:1px solid #000;
    border-left:1px solid #000;
}
th, td {
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
}

答案 1 :(得分:0)

<table>
<thead>
    <tr>
        <th>t1</th>
        <th>t2</th>
        <th>t3</th>
        <th>t4</th>
        <th>t5</th>
    </tr>
</thead>
<tbody>
  <tr>
    <td colspan="5">Colspan=5 here</td>
  </tr>
</tbody>

相关问题