首頁  >  文章  >  web前端  >  thead、tfoot、 tbody製作一個表格

thead、tfoot、 tbody製作一個表格

高洛峰
高洛峰原創
2017-03-02 14:50:481598瀏覽

thead、tfoot 以及tbody標籤實作一個表格範例,這三個標籤分別代表表格的頭部(th)、主題、和底部,能讓表格更加語義化的同時,也能讓我們更方便的控制表格的表現 還有人很變態地用這三個標籤做出標題能跟著表格,或是tbody固定高度,走出自動出現捲軸的功能。 

程式碼如下:

<title>thead、tfoot 以及 tbody标签</title>
    <table border="1">
        <thead>
            <tr>
            <th>科目</th>
            <th>分数</th> 
            </tr>
        </thead>
        <tbody>
            <tr>
            <td>语文</td>
            <td>99</td>
            </tr>
            <tr>
            <td>数学</td>
            <td>60</td>
            </tr>
        </tbody>
        <tfoot>
            <tr>
            <td>总分</td>
            <td>159</td>
            </tr>
        </tfoot>
    </table>


更多thead、tfoot、 tbody製作一個表格相關文章請關注PHP中文網!


陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn