zoukankan      html  css  js  c++  java
  • html 制作复杂table

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

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

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

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

     1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
     2 <html>
     3 <head>
     4     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     5     <title>复杂表格</title>
     6 </head>
     7 <body>
     8     <center>
     9         <table width = "20%" border="1">
    10             <tr>
    11                 <th>网站</th>
    12                 <th colspan="2">统计情况</th>    <!-- colspan="2"  占位,表示这一列占2列 -->
    13             </tr>
    14             <tr>
    15                 <td rowspan="3">奇虎360</td>    <!-- rowspan="2"  占位,表示这一列占3行 -->
    16                 <td>http://hao.360.cn/</td>
    17                 <td>11</td>
    18             </tr>
    19             <tr>
    20                 <td>http://sh.qihoo.com/</td>
    21                 <td>22</td>
    22             </tr>
    23             <tr>
    24                 <td>http://video.so.com/</td>
    25                 <td>33</td>
    26             </tr>
    27         </table>                                                                                                                                                                                                           
    28     </center>
    29 </body>
    30 </html>

    显示:

     

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

  • 相关阅读:
    TF400916错误修复办法
    架构优化
    .net 动态代理的泛型方法支持问题
    解决Kafka-1194问题
    SOA服务总线设计
    SOA初探
    重构心法——提高代码复用率
    重构心法——拆分大对象
    重构心法——你应该这样写方法
    反爬虫那些事儿
  • 原文地址:https://www.cnblogs.com/xudong-bupt/p/3950586.html
Copyright © 2011-2022 走看看