Html Google Chrome PC中的表格单元格失去边框
以下代码,在所有浏览器中-除了PC上最新的Google Chrome之外-在tbody表格单元格上显示边框,如CSS中指定的 Chrome PC显示THAD边框,但不显示TD边框。为什么?这是Chrome中的bug,还是我的HTML/CSS中的bug 这里有一个复制它的方法: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
<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;
}