zoukankan      html  css  js  c++  java
  • html表格元素

    1常规表格

    表格描述
    <table> 定义表格
    <caption> 定义表格标题。
    <th> 定义表格的表头。
    <tr> 定义表格的行。
    <td> 定义表格单元。
    <thead> 定义表格的页眉。
    <tbody> 定义表格的主体。
    <tfoot> 定义表格的页脚。
    <col> 定义用于表格列的属性。
    <colgroup> 定义表格列的组。

    较完整的例子

    <table border="1"> //表格的基本元素  //border值为边框宽度,单位px;

    <caption>666</caption>//表标题
    <thead>//表头
    <tr>//行
    <th>Month</th>//列
    <th>Savings</th>
    </tr>
    </thead>

    <tbody>//表格主体,不包括表头和表脚
    <tr>
    <td>January</td>
    <td>$100</td>
    </tr>
    <tr>
    <td>February</td>
    <td>$80</td>
    </tr>
    </tbody>

    <tfoot>//表脚
    <tr>
    <td>Sum</td>
    <td>$180</td>
    </tr>
    </tfoot>
    </table>

    2.不规则表格

    colspan属性用在td标签中,用来指定单元格横向跨越的列数。

    rowspan的作用是指定单元格纵向跨越的行数,也是用在td标签中。

    <colgroup> 标签用于对表格中的列进行组合,以便对其进行格式化。span属性表示控制列数

    在colgroup内部可以使用col元素,未使用span,则为一列,使用span就代表相应几列。

  • 相关阅读:
    JS中的call()和apply()方法和bind()
    reactjs入门到实战(十)----one-first_app
    49-Reverse Linked List II
    48-Merge Sorted Array
    47-Generate Parentheses
    46.Valid Parentheses
    45-Letter Combinations of a Phone Number
    44-Count and Say
    43-Reverse Nodes in k-Group
    42-Remove Nth Node From End of List
  • 原文地址:https://www.cnblogs.com/cumting/p/6735229.html
Copyright © 2011-2022 走看看