表格標記

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>table</title>
        <style type="text/css">
            td,th{border: 1px solid #CCC;}
            table{border: 1px solid black;}
        </style>
    </head>
    <body>
        <table>
           <caption>Your Content Here</caption>
            <tr>
                <th rowspan="2">&nbsp;</th>
                <th colspan="2">A common header for two subheads</th>
                <th rowspan="2">Header 3</th>
            </tr>
            <tr>
                <th>Header 1</th>
                <th>Header 2</th>
            </tr>
            <tr>
                <th scope="row">Thing A</th>
                <td>data A1</td>
                <td>data A2</td>
                <td>data A3</td>
            </tr>
            <tr><th scope="row">Thing B</th>
                <td>data B1</td>
                <td>data B2</td>
                <td>data B3</td>
            </tr>
            <tr>
                <th scope="row">Thing C</th>
                <td>data C1</td>
                <td>data C2</td>
                <td>data C3</td>
            </tr>
        </table>
    </body>
</html>

這裏寫圖片描述

td:單元格{ colspan 合併列
rowspan 合併行
headers 數據單元格與表頭關聯

th:表頭{colspan 合併列
rowspan 合併行
headers 將表頭與另一個表頭相關聯
scope=”row|col|rowgroup|colgroup” 將表頭與行、行組、列、列組相關聯

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章