Maison  >  Article  >  interface Web  >  thead、tfoot、 tbody制作一个表格

thead、tfoot、 tbody制作一个表格

高洛峰
高洛峰original
2017-03-02 14:50:481598parcourir

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中文网!


Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn