Advertisement
Home Open Editor ❯

HTML span Attribute

Example

<table>
  <colgroup>
    <col style="background-color:red">
    <col span="2" style="background-color:yellow">
  </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

Specifies the number of columns a <col>/<colgroup> element should span. (default value is 1)


Standard Syntax

<element span="number">


Applies to:

The span attribute can be used on the following element:

Element Attribute
<col> span
<colgroup> span

Advertisement

Attribute Values

Value Description
number Specifies the number of columns should span.(default value is 1)
Home Open Editor ❯
Advertisement