HTML <colgroup> element


<colgroup> tag defines a group of table columns. It's a void tag, no closing tag </col> is needed.

An simple table example
HTMLPHPJavascript
HTML Form Tag PHP Form Validation JS Form Submit

HTML Code of above table:
<table border=1>
<colgroup span=2 style="background-color:#CCCCCC">
<caption><b>An simple table example</b></caption>
<tbody>
<tr><th>HTML</th><th>PHP</th><th>Javascript</th></tr>
<tr><td><a href="form.php">HTML Form Tag</a></td>
<td><a href="../php/formvalidation.php">PHP Form Validation</a></td>
<td><a href="../js/submitform.php">JS Form Submit</a></td>
</tr>
</tbody></table>


Attributes of <colgroup> tag;
AttributeDescription
span number of columns covered
valign vertical alignment, including top, middle and bottom. Deprecated in HTML5.
width width of the column. Deprecated in HTML5.