Please note, this is a STATIC archive of website technosmarter.com from 20 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
 

HTML table td colspan attribute


Colspan is used to how many numbers of columns should be used.
In simple words, we used the colspan to take the more column size (width)
Example-
if we declare colspan="1" then column increase one column size .and if declare <td colspan="4"> then column takes the size of four columns .
The following example of a table in which we will use the colspan 2.


HTML td Colspan


<!DOCTYPE html>
<html>
<head>
<title>Type of Heading Tags </title>
</head>
<body>
<table height="150" width="500" border="1">  
<tr> 
<td colspan="2"> Employee Data </td>
<tr>
<td> 
Employee
</td>
<td>
Salary
</td> 
</tr> 
<tr>
<td>
Shiva
</td>
<td> 
20000
</td>  
</tr>
<tr>
<td> 
NEHA
</td>
<td> 
12000
</td>  
</tr>
</table>

</body>
</html>
Run

Note- The HTML td colspan is set to 2.


Please Share

Recommended Posts:-