我想对表格进行一些格式化,但我似乎无法弄清楚如何将底行平均划分为与顶行具有相同的宽度。
我希望顶行像 240 像素一样,并将底行分成两部分,每部分 120 像素。
<table>
<tbody>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
我们将不胜感激!
这就是我在使用 colspan 时遇到的问题:
<table>
<tbody>
<tr>
<td colspan="2">Content</td>
</tr>
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
</tbody>
</table>
最佳答案
看看这个:
th, td {
border: 1px solid black;
}
td{
width:240px;
}
<body>
<table>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<th> </th>
<th> </th>
</tr>
</table>
</body>
关于html - 划分底行以匹配表中的顶行 - HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57166522/