Image

HTML & CSS - HTML TABLES - Cell span for many coloumns

Cell span for many coloumns

For making a cell span more than one column,we use the colspan.
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
    border: 1px solid black;
    border-collapse: collapse;
}
th, td {
    padding: 5px;
    text-align: left;    
}
</style>
</head>
<body>
<h2>Cell that spans two columns:</h2>
<table style="width:50%">
  <tr>
    <th>Name</th>
    <th colspan="2">Telephone</th>
  </tr>
  <tr>
    <td>help4code</td>
    <td>7620705445</td>
    <td>9503107290</td>
  </tr>
</table>
</body>
</html>
O/P