Reputation: 55
I am trying to create a table layout as shown in below image:
<table>
<tr>
<td rowspan="3">1</td>
<td>2</td>
<td rowspan="2">3</td>
</tr>
<tr>
<td rowspan="2">4</td>
</tr>
<tr>
<td>5</td>
</tr>
</table>
The actual result:
Upvotes: 2
Views: 1000
Reputation: 257
It works if we use height and width for td and tr
<html>
<head>
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse:collapse;
}
tr{
height:50px;
}
td{
width:30px;
}
</style>
</head>
<body>
<table>
<tr>
<td rowspan="3"></td>
<td></td>
<td rowspan="2"></td>
</tr>
<tr>
<td rowspan="2"></td>
</tr>
<tr>
<td></td>
</tr>
</table>
</body>
</html>
</body>
</html>
Upvotes: 2