您好,欢迎来到尚车旅游网。
搜索
您的当前位置:首页html表格合并单元格的方法

html表格合并单元格的方法

来源:尚车旅游网

html表格合并单元格的方法

html中,colspan属性是合并列,rowspan属性是合并行,合并行的时候,比如rowspan="2",它的下一行tr会少一列;合并列的时候 colspan="2",此行的列会少一列。

推荐学习:html教程

代码演示:

<table border="1" style={{margin:200}}>
 <tbody> 
 <tr> 
 <th colspan="2">我是占位符</th> 
 <th colspan="2">我是占位符</th> 
 </tr> 
 <tr> 
 <th rowspan="2">我是占位符</th> 
 <th>我是占位符</th> 
 <th>我是占位符</th> 
 <th>我是占位符</th> 
 </tr> 
 <tr> 
 <th>我是占位符</th> 
 <th>我是占位符</th>

 <th>我是占位符</th> 
 </tr>
 </tbody> 

</table>

8601a18b87d6277fd27bba5e25381f30e924fc6f.png

扩展资料:

rowspan规定表头单元格应该横跨的行数。注意: rowspan="0" 告知浏览器使单元格横跨到表格组件中的最后一个行(thead、tbody 或 tfoot)。

Copyright © 2019- sceh.cn 版权所有 湘ICP备2023017654号-4

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务