html不规则表格做法

html不规则表格做法,第1张

两条建议:1、考虑用多个table来拼接,如果下面一行中的列与上面一行的列对齐的,则用一个table,不相同的地方,把外层单元格合并,内层加一个table,设置内层table的列宽,以达到要求。2、考虑用div+css模拟这种不规则表格

colspan和rowspan这两个属性用于创建特殊的表格。

colspan是“column

span(跨列)”的缩写。colspan属性用在td标签中,用来指定单元格横向跨越的列

rowspan的作用是指定单元格纵向跨越的行数。

例如colspan=“3”,rowspan="4"

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>无标题文档</title>

</head>

<body>

<table border="1" width="500">

  <tr>

    <td height="85" colspan="2">&nbsp</td>

    <td>&nbsp</td>

    <td>&nbsp</td>

  </tr>

  <tr>

    <td colspan="2" rowspan="2" height="200">&nbsp</td>

    <td height="100">&nbsp</td>

    <td>&nbsp</td>

  </tr>

  <tr>

    <td colspan="2" rowspan="2">&nbsp</td>

  </tr>

  <tr>

    <td height="102">&nbsp</td>

    <td>&nbsp</td>

  </tr>

</table>

</body>

</html>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/6116496.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-15
下一篇 2023-03-15

发表评论

登录后才能评论

评论列表(0条)

保存