您好,欢迎访问一九零五行业门户网

如何在HTML中包含表格列的组?

使用
标记包含表列组。html 标记用于指定表内一组列的属性。如果需要对 colgroup 中的列应用不同的属性,可以在 colgroup 标记中使用 html col 标记。以下是属性 -
属性

描述
对齐
右左
居中
对齐
char
定义水平对齐方式,html5 不支持。
字符
字符
定义用于对齐文本的字符(与align =char一起使用), html5 不支持。
查奥夫
像素
定义应跨越的列数,不支持html5
跨度
number
定义 应跨越的列数,在 html5 中不支持。
valign
底部中间
顶部
基线
定义垂直对齐方式,html5 不支持。
宽度 像素或% 指定当前列跨越的每列的默认宽度元素,在 html5 中不受支持。
示例您可以尝试运行以下代码来实现 html 中的
标签 -<!doctype html><html> <head> <title>html col tag</title> </head> <body> <p>this example shows a colgroup that has three columns of different widths:</p> <table border = "1"> <colgroup span = "4"> <col width = "40"></col> <col width = "70"></col> <col width = "100"></col> <col width = "130"></col> <col width = "160"></col> </colgroup> <tr> <td>one</td> <td>two</td> <td>three</td> <td>four</td> <td>five</td> </tr> </table> </body></html>
以上就是如何在html中包含表格列的组?的详细内容。
其它类似信息

推荐信息