Liz*_*zza 22 html html-table center tableheader
我希望将一个表头并排放在两个表列的中心.这可能吗?
Spo*_*nNZ 44
<th colspan="2">. This .</th>
有点推断......
<table>
<thead>
<tr>
<th>Single Column</th>
<th colspan="2">Double Column</th>
</tr>
</thead>
<tbody>
<tr>
<td>Column One</td>
<td>Column Two</td>
<td>Column Three</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
这应该足以让你工作.
如果你只有2列,那么我建议使用<caption>
.否则,请按照其他答案中的建议使用colspan.
<table>
<caption>This will span all columns.</caption>
<tr><td>column one</td><td>column two</td></tr>
</table>
Run Code Online (Sandbox Code Playgroud)