Tutorials References Exercises Bootcamps Videos Menu
Sign Up Create Website Get Certified Upgrade

HTML <colgroup> span Attribute

❮ HTML <colgroup> tag


Set the background color of the first two columns using the <colgroup> span attribute:

  <colgroup span="2" style="background:red"></colgroup>
    <td>My first HTML</td>
    <td>My first CSS</td>
Try it Yourself »

Definition and Usage

The span attribute defines the number of columns a <colgroup> element should span.

Tip: To define different properties to a column within a <colgroup>, use the <col> tag within the <colgroup> tag.

Browser Support

span Yes Yes Yes Yes Yes


<colgroup span="number">

Attribute Values

Value Description
number Sets the number of columns a column group should span

❮ HTML <colgroup> tag