Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Google Chrome PC中的表格单元格失去边框_Html_Css_Google Chrome - Fatal编程技术网

Html Google Chrome PC中的表格单元格失去边框

Html Google Chrome PC中的表格单元格失去边框,html,css,google-chrome,Html,Css,Google Chrome,以下代码,在所有浏览器中-除了PC上最新的Google Chrome之外-在tbody表格单元格上显示边框,如CSS中指定的 Chrome PC显示THAD边框,但不显示TD边框。为什么?这是Chrome中的bug,还是我的HTML/CSS中的bug 这里有一个复制它的方法: <table width="505" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <t

以下代码,在所有浏览器中-除了PC上最新的Google Chrome之外-在tbody表格单元格上显示边框,如CSS中指定的

Chrome PC显示THAD边框,但不显示TD边框。为什么?这是Chrome中的bug,还是我的HTML/CSS中的bug

这里有一个复制它的方法:

<table width="505" cellspacing="0" cellpadding="0" border="0">
<tbody>
    <tr>
        <td>Testing</td>
        <td>123</td>
    </tr>
    <tr>
        <td>Testing</td>
        <td>456</td>
    </tr>
</tbody>
<thead>
    <tr>
        <th>foo</th>
        <th>bar</th>
    </tr>
</thead>

试着把t身体放在thead之后

HTML

<table width="505" cellspacing="0" cellpadding="0" border="0">
    <thead>
        <tr>
            <th>foo</th>
            <th>bar</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Testing</td>
            <td>123</td>
        </tr>
        <tr>
            <td>Testing</td>
            <td>456</td>
        </tr>
    </tbody>
</table>

福
酒吧
测试
123
测试
456

发件人:

thead-表元素。thead必须出现在任何caption或colgroup元素之后,即使是隐式定义的,但必须出现在任何tbody、tfoot和tr元素之前

试试这个

table {
    width:736px;
    border-collapse: collapse;
}
thead {
    border-top: 2px solid #aaaaaa;
}
th {
    border: 0;
    padding: 12px 5px;
}
tbody {
    border-top:0;
}         
td {
    padding: 10px 5px;
    border-top: 1px solid #aaaaaa;
    border-bottom: 1px solid #aaaaaa;
}

移除
边框折叠:折叠
,对
TD
使用
边框顶部
,对
表使用
边框底部


我有一个使用
的表-webkit backface visibility:hidden,它隐藏了边框颜色,所以我使用了
-webkit backface visibility:visible

请参见定义和用法,将AD放在车身后面是无效的。(标记必须在以下上下文中使用:作为元素的子元素,在any和元素之后,在any和元素之前)当
thead-th
tbody-td
足够好时,是否真的有必要指定
thead-tr-th
tbody-tr-td
?不要让你的选择器变得比需要的长。嗯。谢谢我应该发现的。thead由服务器端代码生成/调整,因此它的位置很奇怪。
table {
    width:736px;
    border-collapse: collapse;
}
thead {
    border-top: 2px solid #aaaaaa;
}
th {
    border: 0;
    padding: 12px 5px;
}
tbody {
    border-top:0;
}         
td {
    padding: 10px 5px;
    border-top: 1px solid #aaaaaa;
    border-bottom: 1px solid #aaaaaa;
}