数据分析,一般都需要显示数据,就需要使用html做复杂的表格。复杂表格一般是对td的rowspan 、colspan属性值。

在html中<td> 标签定义 HTML 表格中的标准单元格。

  (1)rowspan 属性规定单元格可横跨的行数;

  (2)colspan 属性规定单元格可横跨的列数。

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>复杂表格</title>
</head>
<body>
    <center>
        <table width = "20%" border="1">
            <tr>
                <th>网站</th>
                <th colspan="2">统计情况</th>    <!-- colspan="2"  占位,表示这一列占2列 -->
            </tr>
            <tr>
                <td rowspan="3">奇虎360</td>    <!-- rowspan="2"  占位,表示这一列占3行 -->
                <td>http://hao.360.cn/</td>
                <td>11</td>
            </tr>
            <tr>
                <td>http://sh.qihoo.com/</td>
                <td>22</td>
            </tr>
            <tr>
                <td>http://video.so.com/</td>
                <td>33</td>
            </tr>
        </table>                                                                                                                                                                                                           
    </center>
</body>
</html>

 

显示效果

关于html 制作table的一个注意点 

rowspan 、colspan 可以理解为占位。占行数、列数。

相关文章:

  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
  • 2022-12-23
  • 2021-07-22
  • 2021-05-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
  • 2022-02-25
  • 2021-05-21
  • 2021-09-17
相关资源
相似解决方案