时间:2021-07-01 10:21:17 帮助过:21人阅读

colgroup标签是什么意思?html colgroup标签怎么用
作用:对表格中的列进行组合,以便对其进行格式化。
说明:
如需对全部列应用样式,<colgroup> 标签很有用,这样就不需要对各个单元和各行重复应用样式了。<colgroup> 标签只能在 table 元素中使用。
注释:
所有主流浏览器都支持 <colgroup> 标签。Firefox、Chrome 以及 Safari 仅支持 colgroup 元素的 span 和 width 属性。
html colgroup标签使用示例
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<table width="100%" border="1">
<colgroup span="2"></colgroup>
<colgroup style="color:#0000FF;"></colgroup>
<tr>
<th>商品种类</th>
<th>名称</th>
<th>价格</th>
</tr>
<tr>
<td>衣服</td>
<td>衬衣</td>
<td>53元</td>
</tr>
<tr>
<td>鞋子</td>
<td>板鞋</td>
<td>199元</td>
</tr>
</table>
</body>
</html>效果:

以上就是html colgroup标签怎么用的详细内容,更多请关注Gxl网其它相关文章!