HTML Attributes

HTML colspan attribute

Makes a table cell occupy multiple columns. Default is 1; the conforming range is 1 to 1000. Maintain a coherent table grid. Applicable elements include: <td>, <th>. Check each element’s value rules.

Formal Syntax & Structure

html syntaxhtml
colspan="2"

Parameters & Attributes

NameTypeDescription
colspanpositive integerMakes a table cell occupy multiple columns. Default is 1; the conforming range is 1 to 1000. Maintain a coherent table grid.

Working Example

Example Snippethtml
<table>  <tr>    <th colspan="2">Inventory</th>  </tr>  <tr>    <td>Books</td>    <td>4</td>  </tr></table>
HTML Reference