Advertisement
Home Open Editor ❯

HTML <colgroup> span Attribute

Example

<table>
  <colgroup span="1" style="background-color: red;">
  </colgroup>
<tr>
  <th>No</th>
  <th>First Name</th>
  <th>Last Name</th>
</tr>
<tr>
  <td>01</td>
  <td>John</td>
  <td>Doe</td>
</tr>
<tr>
  <td>02</td>
  <td>Michael</td>
  <td>Jackson</td>
</tr>
</table>

Try this code ❯

Meaning

The span attribute specifies the default number of columns in this group.

Browsers should ignore this attribute if the current column group contains one or more <col> tags.

The default value of this attribute is 1.


Standard Syntax

<colgroup span="number">


Advertisement

Attribute Values

Value Description
number Specifies the number of columns a column group should span
Home Open Editor ❯
Advertisement