Create the table using colspan and rowspan.
Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Create a Table using colspan and rowspan</title>
</head>
<body>
<table border="1">
<th colspan="4">Work Contact Points</th>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Floor/Block</th>
</tr>
<tr>
<td style="background-color:yellow;">Fred</td>
<td style="background-color:DodgerBlue;">fred@megacorp.com</td>
<td style="background-color:yellow;">123456</td>
<td rowspan="2" style="background-color:Green;">
<center>1/A</center>
</td>
</tr>
<tr>
<td style="background-color:DodgerBlue;">Jon</td>
<td style="background-color:yellow;">jon@megacorp.com</td>
<td style="background-color:DodgerBlue;">234567</td>
</tr>
<tr>
<td style="background-color:yellow;">Bill</td>
<td style="background-color:DodgerBlue;">bill@megacorp.com</td>
<td style="background-color:yellow;">345678</td>
<td rowspan="3" style="background-color:red;">
<center>3/C</center>
</td>
</tr>
<tr>
<td style="background-color:DodgerBlue;">Jane</td>
<td style="background-color:yellow;">jane@megacorp.com</td>
<td style="background-color:DodgerBlue;">777444</td>
</tr>
<tr>
<td style="background-color:yellow;">Alison</td>
<td style="background-color:DodgerBlue;">alison@megacorp.com</td>
<td style="background-color:yellow;">888652</td>
</tr>
</table>
</body>
</html>
Output
Comments
Post a Comment