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)
  • 相关阅读:
    端口
    log4j常用配置以及日志文件保存位置
    jbpm node signal
    JBPM3.2 TABLE
    JBPM TaskInstance 对象创建过程
    【转】链接脚本
    快速平方根倒数
    GPS开发之知识储备(NMEA0183)
    HEX文件格式和其校验算法
    NRF51822之IIC(MEMS_LIS2DH12)
  • 原文地址:https://www.cnblogs.com/karl-kidd/p/12334448.html
Copyright © 2011-2022 走看看