In HTML, the `colspan` attribute on a `<th>` element defines how many columns that header cell spans.
For example, `<th colspan="3">Sales</th>` creates a header covering three column positions. It is useful when a table has a grouped heading above several narrower headings, such as a “Quarterly results” heading over January, February, and March columns. The value is a non-negative integer describing the number of columns occupied by the cell.
The usual confusion is between `colspan` and `rowspan`. `colspan` expands horizontally across columns, while `rowspan` expands vertically across rows. The distractor `span` is associated with other HTML elements and is not the table-cell attribute that performs this job; `colwidth` is not the standard attribute for spanning columns.
`<th>` identifies a header cell, whereas `<td>` identifies ordinary table data. Both kinds of cell can use `colspan`, so the attribute controls table structure independently of whether the cell contains a heading or data. Proper header structure also helps browsers and assistive technologies interpret relationships between headings and cells.