
Opening tag : <COLGROUP>
Closing tag: -
Purpose:
The Colgroup tag defines attributes for a group of columns within a table. This has limited use now.
Attributes:
align=alignment
- Specifies the alignment of the columns. Choices are CENTER, JUSTIFY, LEFT or RIGHT.
class=class
- Specifies a stylesheet class to use to format the text.
dir=direction
- Useful for languages with work right to left.
event=javascript
- Specifies some javascript to run after a certain event.
id=name
- Specifying an ID, enables you to dynamically change the columns through a script.
lang=language
- Specifies a language for the text in the columns.
span=#
- Allows the same attributes to span across multiple columns, although the default is 1.
title=string
- You can specify a title for these columns. It won't appear on the webpage, but could be useful for adding keywords to your site.
valign=allignment
- Specifies a vertical alignment for the columns. Choices are BASELINE, BOTTOM, MIDDLE or TOP.
width=#
- Specify the width of the columns. Perhaps the most useful attribute allows the width to be specified in pixels, a percentage, or a relative value.
Example:
<TABLE width=80%>
<COLGROUP align="right" width="20%" span="2">
<COLGROUP align="center" width="20%" span="2">
<COLGROUP align="left" width="20%">
<TR>
<TD>1st Column</TD>
<TD>2nd Column</TD>
<TD>3rd Column</TD>
<TD>4th Column</TD>
<TD>5th Column</TD>
</TR>
</TABLE>
Related Tags:
<Caption></Caption> - Caption Tag.
<Col></Col> - Col Tag.
Back to:
Alphabetical Guide
Guide By Type