HTML <COLGROUP ...>

Usage Recommendation
Use it, but don't rely on it.

  • SPAN: how many columns this affects
  • ALIGN: alignment of cell contents
 
  • WIDTH: Width of the column group

<COLGROUP ...> defines a group of columns in the table and allows you to set properties of those columns. <COLGROUP ...> goes immediately after the <TABLE ...> tag and before any <TR ...>, <THEAD ...>, <TBODY ...>, or <TFOOT ...> tags. <COLGROUP ...> works very much like <COL ...>, but be sure to note that <COLGROUP ...> requires both an opening and closing tag.

<COLGROUP ...> is most useful for defining column groups to use in conjunction with <TABLE RULES=GROUPS> to put borders between groups of columns instead of between every column. For example the following code creates a table that puts the first column in a group by itself, all the remaining columns in a group together, and puts borders between the groups of columns.

<TABLE border="1" bordercolor="#CBD3E1" bgcolor="#F1F4F5"
 CELLPADDING=4 RULES=GROUPS FRAME=BOX>
<COLGROUP></COLGROUP>
<COLGROUP SPAN=3></COLGROUP>

WeekdayDateManagerQty
Monday09/11Kelsey639
Tuesday09/12Lindsey596
Wednesday09/13Randy1135
Thursday09/14Susan1002
Friday09/15Randy908
Saturday09/16Lindsey371
Sunday09/17Susan272

See Table Borders: Between Groups of Columns for more details about putting borders between columns.

<COLGROUP SPAN="..."> >