我正尝试创建一个表格布局,如下图所示:
<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>
实际结果:
答案 0 :(得分:2)
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>