zoukankan      html  css  js  c++  java
  • 四、HTML中表格的书写

    一、表格的标签
        <table>:表格的最外层容器
        <th>: 定义表头
        <tr> : 定义表格行
        <td>: 定义表格单元
        <caption>:定义表格标题    
    二、表格的属性
        border : 表格边框
        cellpadding : 单元格内的空间
        cellspacing : 单元格之间的空间
        rowspan : 合并行(上下合并)
        colspan : 合并列(左右合并)
        align : 左右对齐方式 ( left center right )
        valign :上下对齐方式 ( top middle bottom )
        width、height : 表格的宽高
    表格例子:
    1     <table border="1" cellpadding="30" cellspacing="30"> 
    2         <tr>
    3             <th align="right" width="300">日期</th>
    4             <th colspan="2">天气</th>
    5             <th>出行情况</th>
    6         </tr>
    7     </table>
    三、语义化标签:
    <thead>、<tbody>、<tfoot> 
    并不会对表格产生任何影响,语义化更好。
    一个表格table中,只能有一个thead和tfoot,但是可以有多个tbody
     1 <table border="1" cellpadding="30" cellspacing="30"> 
     2     <thead>
     3         tr>
     4             <th colspan="4">出行情况</th>
     5         </tr>
     6     </thead>
     7     <tbody>
     8         <tr>
     9             <th align="right" width="300">日期</th>
    10             <th colspan="2">天气</th>
    11             <th>出行情况</th>
    12         </tr>
    13     </tbody>
    14     <tfoot>
    15         <tr>
    16             <th align="right" width="300">日期</th>
    17             <th colspan="2">天气</th>
    18             <th>这是结尾</th>
    19         </tr>
    20     </tfoot>
    21 </table>
    注:表格也是有嵌套规范的。
    A True Master Is An Eternal Student(真正的大师总是怀着一颗学徒的心) ------(Master Yi)
  • 相关阅读:
    AC日记——Little Elephant and Numbers codeforces 221b
    AC日记——Little Elephant and Function codeforces 221a
    AC日记——Mice and Holes codeforces 797f
    AC日记——Sliding Window poj 2823
    Poj 2976 Dropping tests(01分数规划 牛顿迭代)
    Bzoj 1968: [Ahoi2005]COMMON 约数研究
    洛谷 P2424 约数和
    Hdu Can you find it?(二分答案)
    SPOJ GSS1
    Bzoj 2243: [SDOI2011]染色(树链剖分+线段树)
  • 原文地址:https://www.cnblogs.com/karl-kidd/p/12334448.html
Copyright © 2011-2022 走看看