- 0133技术站
- 联系QQ:88526
- QQ交流群

- 微信公众号

在 HTML5 中,不支持 <colgroup> align 属性。
这个属性定义每列元素内容的水平对齐方式,支持的值有:
left:元素中内容左对齐
center: 元素中内容居中
right: 元素中内容右对齐
justify:插入空格使元素中内容两端对齐
char: 针对确定的字符数设置最小偏移量进行布局,通过 char 和 charoff 属性进行定义未实现
此属性默认值为 left 。后代的 <col> 元素可以用它们自己的 align 属性值重写该属性。
只有 Opera 和 Internet Explorer 8 及之前的版本(IE 9 不支持)支持 align 属性(IE 9 不支持)。
<colgroup align="left|right|center|justify|char">
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <table width="100%" border="1"> <colgroup span="2" align="left"></colgroup> <colgroup align="right"></colgroup> <tr> <th>ISBN</th> <th>Title</th> <th>Price</th> </tr> <tr> <td>3476896</td> <td>My first HTML</td> <td>$53</td> </tr> </table> </body> </html>
点击 "运行实例" 按钮查看在线实例
推荐手册