在HTML中将表单元格拆分为两列

编程入门 行业动态 更新时间:2024-10-24 20:24:23
本文介绍了在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">&nbsp;</th> <td>&nbsp;</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">&nbsp;</th> <td>&nbsp;</td> <!-- The following two cells will appear under the same header --> <td>Col 1</td> <td>Col 2</td> </tr> </table>

更多推荐

在HTML中将表单元格拆分为两列

本文发布于:2023-10-27 03:32:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1532189.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   中将   HTML

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!