HTML colgroup align property
Examples
Two <colgroup> element table provides three different alignment (Note that the first <colgroup> element spans two):
<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>
<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>
try it"
Browser Support
Only Opera and Internet Explorer 8 and earlier versions (IE 9 does not support) support align attribute (IE 9 does not support).
Definition and Usage
In HTML5 does not support <colgroup> align attribute.
Align attribute specifies the horizontal alignment of the contents of the column group.
grammar
<colgroup align="left|right|center|justify|char">
Property Value
值 | 描述 |
---|---|
left | 左对齐内容(默认值)。 |
right | 右对齐内容。 |
center | 居中对齐内容(th 元素的默认值)。 |
justify | 对行进行伸展,这样每行都可以有相等的宽度(就像在报纸和杂志中)。 |
char | 将内容对准指定字符。 |
HTML <colgroup> tag