COLGROUP (<colgroup>) Tag

by Jai 10-Jun-19

0 214

The <colgroup> tag describes a collection of columns with mutual properties inside a table. It works identical to a parent container containing several < col> elements, used to apply properties in a table.

The <colgroup> tag is  written inside <table> tag, before the <thead>, <tbody>, <tfoot> and <tr> and after <caption>. The <colgroup> tag comes in pairs thus, closing </colgroup> tag is also required.

Browsers Support:

Google Chrome
Internet Explorer

COLGROUP (<colgroup>) Tag

COLGROUP (<colgroup>) Tag

COLGROUP (<colgroup>) Tag

COLGROUP (<colgroup>) Tag


<!DOCTYPE html>
<title>The ColgroupTag</title>
table, td, th {
border: 2px solid gray;
border-collapse: collapse;}
<h2>Example of Colgroup Tag</h2>
<p><b>Note:</b> The colgroup tag must be used with table element after caption & before thead or tbody elements</p>
<table width="450">
<caption>Random Details </caption>
<col span="2" style="background-color:red">
<col style="background-color:yellow">
<th>Sr. No.</th>


COLGROUP (<colgroup>) Tag


Discount Coupons

SEMRush FREE Trial – PRO Account for 14 Days

FREE Pro Account worth $99.95 for 14 Days.


    Waiting for your comments

Leave a Reply