我有一张如下表(左侧) - 如何让它像右边那样?
<table>
<thead>
<tr>
<td colspan='3' rowspan='2'>Lorem</td>
<td>1</td>
</tr>
<tr>
<td>2</td>
</tr>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
</thead>
</table>
答案 0 :(得分:1)
像这样:
<table>
<thead>
<tr>
<td colspan='3'>Lorem</td>
</tr>
</thead>
<tbody>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
</tbody>
</table>
答案 1 :(得分:0)
这是你的代码!!
<强> HTML 强>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/all.css"/>
<title>STACKOVERFLOW</title>
</head>
<body>
<table>
<tr>
<td colspan="3">Lorem</td>
</tr>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
</table>
</body>
</html>
<强> CSS 强>
table {border-collapse: collapse}
table td {
border: 1px solid #ccc;
}
答案 2 :(得分:0)
<table>
<thead>
<tr>
<td colspan='3'>Lorem</td>
</tr>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
</thead>
</table>