html5之表格元素

來源:互聯網
上載者:User

標籤:lap   group   組織   體系   idt   通過   通用   包含   實現   

 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4     <meta charset="UTF-8"> 5     <title>表格元素</title> 6 </head> 7 <body> 8 <h4>設定表格背景色為黑色,儲存格間距為1px<br/>通過設定背景色為黑色可以實現邊框效果</h4> 9 <table style="background-color: #cccccc;border-collapse: separate;border-spacing: 1px;text-align: center" >10     <caption><b>瘋狂java體系圖書</b></caption>11     <!--定義所有列的背景色都是白色-->12     <colgroup style="background-color: white">13         <!--設定第一列寬160px-->14         <col style="width: 160px"/>15         <!--定義橫跨兩列,設定這兩列各寬100px-->16         <col span="2" style="width:100px"/>17     </colgroup>18     <thead>19     <tr>20         <th>書名</th>21         <th>作者</th>22         <th>價格</th>23     </tr>24     </thead>25     <tfoot>26     <tr>27         <td colspan="3" style="text-align: right">現總計:2本圖書</td>28     </tr>29     </tfoot>30     <tbody>31     <tr>32         <td>瘋狂java講義</td>33         <td>李剛</td>34         <td>109</td>35     </tr>36     <tr>37         <td>輕量級Java EE公司專屬應用程式實戰</td>38         <td>李剛</td>39         <td>89</td>40     </tr>41     </tbody>42 </table>43 </body>44 </html>

 

<colgroup>組織多個<col/>元素,指定屬性對它包含的所有<col/>元素有效,可指定id,style,class等通用屬性

<col/>用於制定表格一列或者多列的整體屬性,span屬性指定受影響列數,可指定id,style,class等通用屬性

設定表格背景色為黑色,儲存格間距為1px
通過設定背景色為黑色可以實現邊框效果
瘋狂java體系圖書
書名 作者 價格
現總計:2本圖書
瘋狂java講義 李剛 109
輕量級Java EE公司專屬應用程式實戰 李剛 89

html5之表格元素

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.