本文介绍了在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?
小提琴
推荐答案像这样 jsfiddle/8ha9e/ 1 /
将 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中将表单元格拆分为两列
发布评论