html 製作複雜table

來源:互聯網
上載者:User

標籤:style   blog   http   color   os   io   使用   strong   ar   

資料分析,一般都需要顯示資料,就需要使用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 可以理解為佔位。占行數、列數。

html 製作複雜table

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.