|
|
HTML <colgroup> tag
Syntax
<colgroup> - </colgroup>
Definition and Usage
The COLGROUP element creates a column group, a structural division within
a table that can be appointed attributes with style sheets or HTML. A table may
inlude more than one column group.
If used, COLGROUP must be after the optional CAPTION
and before the optional THEAD
in the TABLE. The structural divisions defined by COLGROUP
allow authors to easily suggest a presentation for groups of columns through style
sheets.
Optional Attributes
| Attribute |
Value |
Description |
| align |
right
left
center
justify
char |
Defines the horizontal alignment of the contents in the
column group |
| char |
character |
Defines a character to use to align text on (use with
align="char") |
| charoff |
pixels
% |
Defines an alignment offset to the first character to
align on, as set with char |
| span |
number |
Defines the number of columns the <colgroup> should
span |
| valign |
top
middle
bottom
baseline |
Defines the vertical alignment of the contents in the
column group |
| width |
%
pixels
relative_length |
Defines the width of the column group.
Note: The width attribute can be overridden by settings in <col>
|
Standard Attributes
| id, class, title, style, dir, lang, xml:lang |
For a full description, go to Standard
Attributes.
Event Attributes
| onclick, ondblclick, onmousedown, onmouseup, onmouseover,
onmousemove, onmouseout, onkeypress, onkeydown, onkeyup |
For a full description, go to Event Attributes.
Example
| Source |
Output |
This example shows a table that uses <colgroup>:
<table border="2">
<colgroup span="4">
</colgroup>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
</table> |
This example shows a table that uses colgroup:
|
|
|