首页 > 编程知识 正文

td标签合并,td有哪些属性

时间:2023-05-05 18:57:24 阅读:57814 作者:1170

我想只用一个table实现这样的表:

可以看到第2行和第3行的列数不同。 定义第二行和第三行的width是徒劳的,它会影响第一行的合成。

可以用colspan实现跨行。

例如,假设第二行的第二列跨越与之对应的前一行的第三行。

代码如下。

table style='width: 100%; letter-spacing: 0.5px;' theadtrclass=' tr style2' th class=' TD width2' style=' width 336025 %;' {{_('connect_status ' ) }/ththclass=' TD width2' style=' width 336025 %;' { { _ (' IP _ addr ' } } }/ththclass=' TD width2' style=' width 336025 %;' linkocal { _ { ' address ' } }/ththclass=' TD width2' style=' width 336025 %;' IPV6{{_(default_gateway ) }/th/theadtbodytrclass=' tr style3' TD class=' TD width3' style=' width-/tdtd class '-/tdtd class=' TD width3' style=' width :25 %; '-/tdtd class=' TD width3' style=' width :25 %; '-/TD/tr/tbodytheadtrclass=' tr style2' th class=' TD width2' colspan='1' { _ { prefix _ get _ type ' } } } } /

寻找资料时,有博客说,table是如何跨越半行的

其中有参考项目代码。 github窗体横断面项目

研究表明,实现跨半行就是把它对应的上一行又拆解成两行:colspan=2;再在要实现跨半行的地方写上colspan=1即可。

代码如下。

table style='width: 100%; letter-spacing: 0.5px;' theadtrclass=' tr style2' th class=' TD width2' style=' width 336025 %;' {_ () connect_status ) }/ththclass=' TD width2' colspan='2' style=' width 336025 %;' { { _ (' IP _ addr ' } } }/ththclass=' TD width2' style=' width 336025 %;' linkocal { _ { ' address ' } }/ththclass=' TD width2' style=' width 336025 %;' IPV6{{_(default_gateway ) }/th/theadtbodytrclass=' tr style3' TD class=' TD width3' style=' width-/tdtd class '-/tdtd class=' TD width3' style=' width :25 %; '-/tdtd class=' TD width3' style=' width :25 %; '-/TD/tr/tbodytheadtrclass=' tr style2' th class=' TD width2' colspan='2' { _ { prefix _ get _ type ' } } } }/theadtbodytrclass=' tr style3' TD class=' TD width3' colspan='2'-/tdtd class=' TD width3' colspan=tbodytheadtrclass=' tr style2' th class=' TD width2' IPv6 { _ () pri_DNS ththclass=' TD width2' colspan ththclass=' TD width2' { _ { prefix } }/th/theadtbodytrclass=' tr style3' TD class='

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。