martin2k

The COLGROUP Tag

HomeForumTutorials Tags:
 
 

Name

Column Group

Description

Defines the characteristics of columns in a table.  Must be used within the TABLE tag.  It is possible to create columns in tables without the COLGROUP tag.

Attributes

ALIGN

Specifies the horizontal alignment of the content in the cells.  The possible values are:

Value
center
justify
left
right

SPAN

Specifies how many columns the COLGROUP will affect.

VALIGN

Specifies the vertical alignment of the content in the cells.  The possible values are:

Value
baseline
bottom
middle
top

WIDTH

Specifies the width of the column.  This attribute has priority over the COLGROUP width attribute.

Related Tags

The COL tag is used within the TABLE tag.

Example

Code

<table border="1" cellpadding="1" cellspacing="2">
<colgroup span="2" align="center" width="300">
</colgroup>
<tr>
<td>Cell contents</td>
<td>Cell contents</td>
<td>Cell contents</td>
</tr>
<tr>
<td>Cell contents</td>
<td>Cell contents</td>
<td>Cell contents</td>
</tr>
</table>

Generates

Cell contents Cell contents Cell contents
Cell contents Cell contents Cell contents

As COLGROUP was set to span 2 columns, the width and align attributes only affect the first two columns in the table.


Please fill in the below form if you have any comments or additional information you want to add about the above information.  If you have any questions, please visit the ForumAny questions sent using this form will be ignored.

* - Mandatory

*Name: E-mail:

*Comments:

*Please type the following code (your comment cannot be accepted without it):


© Martin Allen 1999 - 2006.  Last updated Sunday 01 October 2006 07:19:44 PM +0100.