HTML colgroup col 标签

<colgroup> <col> 标签

这两组标签组合起来,对表格列的处理可以更加的灵活。

<table border="1">

<colgroup>
<col> <!-- 每个col代表一个列 | 当前代表第一列不处理 -->
<col span="2" style="background:yellow"> <!-- 从第二列开始处理两个列,背景颜色为黄色 -->
</colgroup>

<tr>
<td>one</td><td>two</td><td>three</td>
</tr>

<tr>
<td>four</td><td>five</td><td>six</td>
</tr>

</table>

显示效果

onetwothree
fourfivesix
更多教程 HTML5 教程 CSS3 教程 JavaScript 教程 JQuery 教程 React.js 教程 Node.js 教程 Koa2 教程 Python 教程 Linux 教程