
Opening tag : <COL>
Closing tag: -
Purpose:
The Col tag defines attributes for columns within a table. Alternatively the TD tag could be used for column attributes.
Attributes:
align=alignment
- Specifies the alignment of a column. 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 column through a script.
lang=language
- Specifies a language for the text in the column.
span=#
- Allows the same attributes to span across multiple columns, although the default is 1.
title=string
- You can specify a title for this column. 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 column. Choices are BASELINE, BOTTOM, MIDDLE or TOP.
width=#
- Specify the width of the column. Perhaps the most useful attribute allows the width to be specified in pixels, a percentage, or a relative value.
Example:
<TABLE width=80%>
<COL width=40%>
<COL width=40%>
<COL width=20%>
<TR>
<TD>1st Column</TD>
<TD>2nd Column</TD>
<TD>3rd Column</TD>
</TR>
</TABLE>
Related Tags:
<Caption></Caption> - Caption Tag.
Back to:
Alphabetical Guide
Guide By Type