HTML <td> colspan Attribute

❮ HTML <td> tag

Example

An HTML table with a table cell that spans two columns:

<table>
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
  <tr>
    <td colspan="2">Sum: $180</td>
  </tr>
</table>
Try it Yourself »

Definition and Usage

The colspan attribute defines the number of columns a cell should span.


Browser Support

Attribute
colspan Yes Yes Yes Yes Yes

Syntax

<td colspan="number">

Attribute Values

Value Description
number Specifies the number of columns a cell should span

❮ HTML <td> tag
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.