html5 colgroup标签,HTML5 <colgroup> 标签

实例

HTML5

标签可以组合标签。 和 标签为表格中的三个列设置了背景色:
ISBNTitlePrice
3476896My first HTML$53
尝试一下 »

浏览器支持

8ba5826087735225052def3309fb39d3.gif

10a23bc891b33087b52dd6e9f3e8bc01.gif

824d63fb5a3afba957fa0613c7e310a6.gif

b4042546111002b6a8e5b425829d10a6.gif

a938b85d3cfdfc9f3f06c2e04e4e71fd.gif

所有主流浏览器都支持

标签。

标签定义及使用说明

标签用于对表格中的列进行组合,以便对其进行格式化。

通过使用

标签,可以向整个列应用样式,而不需要重复为每个单元格或每一行设置样式。

注释:只能在

提示:如果想对

中的某列定义不同的属性,请在 标签内使用 标签。

HTML 4.01 与 HTML5之间的差异

HTML5 中不再支持 HTML 4.01 中的大部分属性。

属性属性 值 描述

align (已废弃) left

right

center

justify

char HTML5 不支持。规定在列组合中内容的水平对齐方式。

char (已废弃) character HTML5 不支持。规定根据哪个字符来对齐列组中的内容。

number HTML5 不支持。规定第一个对齐字符的偏移量。

number 规定列组应该横跨的列数。

top

middle

bottom

baseline HTML5 不支持。定义在列组合中内容的垂直对齐方式。

width (已废弃) pixels

%

relative_length HTML5 不支持。规定列组合的宽度。

全局属性

标签支持 HTML 的全局属性。

事件属性

标签支持 HTML 的事件属性。
<!DOCTYPE html> <html> <head> <style> table { border-collapse: collapse; width: 100%; } td, th { border: 1.5px solid black; padding: 5px; } </style> </head> <body> <table> <colgroup> <col style="width: 5px;"> <col style="width: 5px;"> <col style="width: 5px;"> <col style="width: 5px;"> <col style="width: 5px;"> <col style="width: 5px;"> <col style="width: 5px;"> <col style="width: 50px;"> <col style="width: 1000px;"> <col style="width: 100px;"> <col style="width: 100px;"> <col style="width: 100px;"> <col style="width: 100px;"> <col style="width: 100px;"> <col style="width: 50px;"> </colgroup> <tr> <td contenteditable="true"><input type="text" oninput="filterTable(0)" placeholder="工艺膜层"></td> <td contenteditable="true"><input type="text" oninput="filterTable(1)" placeholder="AOI Step"></td> <td contenteditable="true"><input type="text" oninput="filterTable(2)" placeholder="不良类型"></td> <td contenteditable="true"><input type="text" oninput="filterTable(3)" placeholder="Layer(Code)"></td> <td contenteditable="true"><input type="text" oninput="filterTable(4)" placeholder="Type"></td> <td contenteditable="true"><input type="text" oninput="filterTable(5)" placeholder="Dpet"></td> <td contenteditable="true"><input type="text" oninput="filterTable(6)" placeholder="Subcode"></td> <td contenteditable="true">Code描述</td> <td contenteditable="true">Image1</td> <td contenteditable="true">Image2</td> <td contenteditable="true">Image3</td> <td contenteditable="true">Image4</td> <td contenteditable="true">Image5</td> <td contenteditable="true">Image6</td> <td contenteditable="true">判定细则</td> </tr> </thead> <tbody> <tr> <td contenteditable="true">ACT</td> <td contenteditable="true">Particle</td> <td contenteditable="true">ACT</td> <td contenteditable="true">Particle</td> <td contenteditable="true">ACT</td> <td contenteditable="true">Particle</td> <td contenteditable="true">ACT</td> <td contenteditable="true">Particle</td> <td> <input type="file" onchange="previewImage(this)" onclick="showPopup(this.src)"style="width: 100px; height: auto;" > </td> <td> <input type="file" onchange="previewImage(this)"onclick="showPopup(this.src)" style="width: 100px; height: auto;"> </td> <td> <input type="file" onchange="previewImage(this)" onclick="showPopup(this.src)"style="width: 100px; height: auto;"> </td> <td> <input type="file" onchange="previewImage(this)" onclick="showPopup(this.src)"style="width: 100px; height: auto;"> </td> <td> <input type="file" onchange="previewImage(this)" onclick="showPopup(this.src)"style="width: 100px; height: auto;"> </td> <td> <input type="file" onchange="previewImage(this)"onclick="showPopup(this.src)"style="width: 100px; height: auto;"> </td> <td contenteditable="true">Particle</td> </tr> </tbody> </table> </body> </html>这个代码内为什么无法调整列宽
07-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值