search engine optimization articles do it yourself seo hiring search engine experts html and search engine optimization web site analysis and submission service

HTML Colgroup Tag Tutorial

Browser Support

Internet Explorer Firefox Opera Safari Chrome
Firefox has limited support.

The colgroup tag is similar to the col tag. It allows you to apply HTML attributes and CSS styles to an entire table column at once, only with the colgroup you can group multiple columns together.

The colgroup tag can only be used with the table element.

Here's an example of usage:

  <table width="460" border="1">
<colgroup span="2" style="width: 140px;"></colgroup>
<colgroup style="background-color: #cdc;" width="60"></colgroup>
  <tr>
  <th>Product</th>
  <th>Description</th>
  <th>Price</th>
  </tr><tr>
  <td>CSS Made Easy</td>
  <td>Learn CSS the easy way.</td>
  <td>$27.00</td>
  </tr><tr>
  <td>Tables Made Easy</td>
  <td>All about HTML tables.</td>
  <td>$17.00</td>
  </tr>
  </table>

Notice the first colgroup shows span="2" as an attribute and value. This is how multiple columns are grouped together. Close one colgroup before opening another. Note that you should not place any content between the opening <colgroup> tag and the closing </colgroup> tag.

While the "colgroup" element is supported by all major browsers, Firefox doesn't recognize many HTML attributes or CSS styles you should be able to use with it, so you'll need to test what works and what doesn't in Firefox when you use this element.

Here's how that table looks on a web page:

Product Description Price
CSS Made Easy Learn CSS the easy way. $27.00
Tables Made Easy All about HTML tables. $17.00

Based on your interest in this tutorial you may also be interested in:

This concludes the HTML Col Tag Tutorial.
Back | HTML Tag Chart | HTML Index | Web Design Tutorials
search engine optimization course
If you want your web site to rank high in the search engines . . . what are you going to do to get it there? Check out my search engine optmization guide, SEO for YOU: Search Engine Optimization for Ordinary Everyday People!

Check out SEO for YOU now!

Almost a Newsletter

Subscribe today for exclusive website design tutorials and grab some free gifts to boot! Learn more, or subcribe below:
Email:

First Name:

Privacy Policy

Did you know...

The member's site has about 100 standards compliant HTML and CSS tutorials, 31 handy reference charts, reprintable content, web graphics, exclusive fonts, free software, free ebooks and more? All this for less than 9 cents a day! [ Details ]
See my fancy bottom! :)