本文介绍了在HTML中将表单元格拆分为两列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有下表:
<table border="1">
<tr>
<th scope="col">Header</th>
<th scope="col">Header</th>
<th scope="col">Header</th>
</tr>
<tr>
<th scope="row"> </th>
<td> </td>
<td>Split this one into two columns</td>
</tr>
</table>
我想拆分包含 em>划分为两个单元格/列。我该如何解决这个问题?
And I wish to split the cell which contains "Split this one into two columns" into two cells/columns. How do I go about this?
推荐答案
像这样
将 colspan =2
添加到第三个 ; th>
,然后在第二行中有4个< td>
。
Add colspan="2"
to the 3rd <th>
and then have 4 <td>
's in your second row.
<table border="1">
<tr>
<th scope="col">Header</th>
<th scope="col">Header</th>
<th scope="col" colspan="2">Header</th>
</tr>
<tr>
<th scope="row"> </th>
<td> </td>
<!-- The following two cells will appear under the same header -->
<td>Col 1</td>
<td>Col 2</td>
</tr>
</table>
这篇关于在HTML中将表单元格拆分为两列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!