VOOZH about

URL: https://www.geeksforgeeks.org/html/html-th-colspan-attribute/

⇱ HTML <th> colspan Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML <th> colspan Attribute

Last Updated : 22 May, 2026

The colspan attribute in the <th> tag is used to make a header cell span across multiple columns. It helps in creating grouped or merged table headers.

  • Specifies the number of columns a header cell should span (positive integer, default is 1).
  • Used to merge header cells horizontally.
  • Helps in creating grouped table headings.

Syntax: 

<th colspan="number"> 

Attribute Values: It contains single value number which contains the numeric value to sets the number of column a header cell should span. 

Example: This example illustrates the use of colspan attribute in <th> tag. 

Comment
Article Tags: