Skip to content
Related Articles

Related Articles

HTML | <th> colspan Attribute

View Discussion
Improve Article
Save Article
  • Last Updated : 01 Aug, 2022

 The <th> colspan Attribute in HTML is used to specify a number of columns a header cell should span. 


<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. 


<!DOCTYPE html>
        <title>HTML colspan Attribute</title>
            table, th, td {
                border: 1px solid black;
                border-collapse: collapse;
                padding: 6px;
        <h1 style = "color: green;">GeeksforGeeks</h1>
        <h2>HTML &lt;th&gt;colspan Attribute</h2>
                <th colspan="2">Expense</th>



Supported Browsers: The browser supported by HTML <th>colspan attribute are listed below:

  • Google Chrome 1 and above
  • Edge 12 and above
  • Internet Explorer
  • Firefox 1 and above
  • Opera
  • Safari

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!