Colgroup Tag in HTML | HTML COLGROUP Tag

HTML COLGROUP (<colgroup>) Tag

0 2153

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


<!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>


Best WordPress Hosting


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price

Leave a Reply

    Waiting for your comments