Html Firefox中的表头边框错误

Html Firefox中的表头边框错误,html,css,Html,Css,我想知道,这是否是一个错误。正如您在上所看到的,所有单元格周围只有顶部边框,而不是边框。请注意,IE9按预期绘制边框。另外请注意,如果在中移动的内容,Firefox将开始绘制IE边框 HTML <table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> <th>Header 3</th&

我想知道,这是否是一个错误。正如您在上所看到的,所有单元格周围只有顶部边框,而不是边框。请注意,IE9按预期绘制边框。另外请注意,如果在
中移动
的内容,Firefox将开始绘制IE边框

HTML

<table>
<thead>
    <tr>
        <th>Header 1</th>
        <th>Header 2</th>
        <th>Header 3</th>
    </tr>
</thead>
<tfoot>
    <tr>
        <td colspan="3">
            <span class="norecords">No records found.</span>
        </td>
    </tr>   
</tfoot>
<tbody></tbody>

您的问题是
t正文
-如果删除此空标记(或向其添加一行),它将工作:

这适用于所有人

<table border=0 cellspacing=0 cellpadding=0>
    <thead>
        <tr>
            <th>Header 1</th>
            <th>Header 2</th>
            <th>Header 3</th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="3">
                <span class="norecords">No records found.</span>
            </td>
        </tr>   
    </tfoot>
    <tbody></tbody>
</table>

这是因为浏览器处理折叠边界的方式不同

在firefox中,没有
tr
的空
tbody
将被视为无边框,无边框边缘将覆盖近行的边缘


只要在你的箱子里去掉未使用的
t车身
,或者至少放一对

我用的是chrome,边框很好用AAAA,你说得对。这是html规范的一部分还是什么?我只是认为不同的浏览器处理表中的空标记的方式不同——比如以前空单元格有问题(不确定是否仍然有问题!)总之,这很奇怪。我不明白为什么空正文会影响标题单元格的左右边框。-我认为在您的情况下,
tfoot
应该是
tbody
,因为您的表实际上没有任何页脚信息-将tfoot放在tbody之前的唯一原因是在加载任何长表之前加载页脚信息我遵循w3schools的建议。请参见,即“标记必须在以下上下文中使用:作为元素的子元素,在any和元素之后,在any和元素之前。”
<table border=0 cellspacing=0 cellpadding=0>
    <thead>
        <tr>
            <th>Header 1</th>
            <th>Header 2</th>
            <th>Header 3</th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="3">
                <span class="norecords">No records found.</span>
            </td>
        </tr>   
    </tfoot>
    <tbody></tbody>
</table>
table {
    background-color: #EFEFEF;
    border: 1px solid #BCBCBC;
}
th, td {
    padding: 10px;
}
th {
    border: 1px solid #BCBCBC;
}