|
COL
The COL element allows authors to group together attribute specifications for table columns. The COL does not group columns together structurally -- that is the role of the COLGROUP element. COL elements are empty and serve only as a support for attributes. They may appear inside or outside an explicit column group (i.e., COLGROUP element). They include SPAN if more than 1 column is included, and STYLE attributes.
The COLGROUP command allows you to set parameters to entire columns of data in a table.
The only properties that should have an effect on columns are background, border, visibility and width. Similarly, COL style="visibility: hidden" is allowed to hide the column by reason of its inheritance whereas to hide the column actually requires COL style="visibility: colapse".
IE 4 applies text-align to TABLEs, which is incorrect since they are block elements, whereas text-align only applies to inline elements.
<TABLE BORDER="1"><TR>
<COLGROUP width=100 ALIGN="right"
BGCOLOR="plum">
<TD>Cell Data</TD><TD>Cell Data</TD>
</COLGROUP></TR><TR>
<TD>Cell Data</TD><TD>Cell Data</TD>
</TR></TABLE> | |
Cell Data | Cell Data |
Cell Data | Cell Data
|
|
SPAN allows the COLGROUP attributes to span across adjacent columns.
Here's what it looks like:
<TABLE BORDER="1" width="250"><TR>
<COLGROUP ALIGN="right" SPAN="2"
BGCOLOR="pink">
<TD>Cell Data</TD>
<TD>Cell Data</TD><TD>Cell Data
</TD></COLGROUP></TR><TR>
<TD>Cell Data</TD>
<TD>Cell Data</TD><TD>Cell Data
</TD></TR></TABLE>
| |
Cell Data |
Cell Data | Cell Data
|
Cell Data |
Cell Data | Cell Data
|
|
WIDTH and VALIGN
Width can be set in either pixels or percentages.
VALIGN sets the cell text's alignment in a vertical sense. You can set it to top, bottom, or middle.
Here's what it looks like:
<TABLE BORDER="1"><TR>
<COLGROUP width=150 ALIGN=right
VALIGN=bottom BGCOLOR=palegreen>
<TD>Cell Data</TD><TD>Cell Data<BR>xxx
</TD></COLGROUP></TR><TR>
<TD>Cell Data</TD><TD>Cell Data<BR>xxx
</TD></TR></TABLE>
| |
Cell Data | Cell Data xxx |
Cell Data | Cell Data xxx |
|
Each COLGROUP is separately defined.
For example:
<TABLE border=1 bordercolor=red>
<COLGROUP style="background-color:pink">
<COLGROUP style="background-color:lightblue">
<TR><TD>51
<TD>52</TD></TR><TR>
<TD>Cell Data</TD></COLGROUP></COLGROUP>
<TD style="background-color:thistle"
onMouseover="this.style.backgroundColor='yellow';"
onMouseout="this.style.backgroundColor='yellowgreen';">
Cell Data</TD></TR></TABLE>
| |
51 notes | 52 |
100 | 55 |
Cell Data |
Visit here | |
|