我希望隐藏表格中第一列的标题,以获得这样的外观:
所以我正在使用 CSSvisibility: hidden;
来做到这一点。上面的屏幕截图是在 Chrome 中拍摄的,它可以完美运行。但是,这发生在 Firefox 中:
如何让 Firefox 隐藏表格中第一列的标题?
编辑:这是我的表格 CSS,根据要求:
.styledtable{
width:100%;
table-layout:fixed; /*each column same width, unless width explicitly specified*/
border:1px solid black;
border-collapse:collapse;
}
.styledtable td, .styledtable th{
border:1px solid black;
padding:3px;
}
.styledtable th{ background:#cfcfcf; }
.styledtable td{ background:white; }
/* in a table with the first columnn empty (ie. with actions in the column below it),
* make the first column take up space, but not actually appear.
* Usage: <th style="width:40%;" class="firstcol"> </th>
*/
.firstcol{
visibility:hidden;
}
/*every second row different color, if the table itself doesn't have the class "no-odd-row-highlight"*/
.styledtable:not(.no-odd-row-highlight) tr:nth-child(odd) td{ background:#eeeeee; }