use*_*567 1 html javascript css jquery
我跟随colgroup无法正常工作.
<colgroup class="" style="background-color:#FF0000;"></colgroup>
Run Code Online (Sandbox Code Playgroud)
请看这个jsfiddle.我在colgroup上的样式不起作用.
您可以设置的大多数属性colgroup都不会产生影响,因为根据定义,表格单元格从tr元素(行)继承属性,而不是列或列组(具有继承的程度).
在CSS中,直接在单元格元素上设置属性.例如,要设置前两列的背景颜色,假设仅对td单元格使用标记,请使用
td:first-child, td:first-child + td {
background: #f00;
color: #fff;
}
Run Code Online (Sandbox Code Playgroud)