码迷,mamicode.com
首页 > Web开发 > 详细

HTML table元素

时间:2017-06-18 11:50:52      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:技术   cheetah   doctype   div   alt   asi   html   example   href   

搬运,内容来自HTML Dog.

 

简单示例

<!DOCTYPE html>
<html>

    <body>
        <table>
            <tr>
                <td>Row 1, cell 1</td>
                <td>Row 1, cell 2</td>
                <td>Row 1, cell 3</td>
            </tr>
            <tr>
                <td>Row 2, cell 1</td>
                <td>Row 2, cell 2</td>
                <td>Row 2, cell 3</td>
            </tr>
            <tr>
                <td>Row 3, cell 1</td>
                <td>Row 3, cell 2</td>
                <td>Row 3, cell 3</td>
            </tr>
            <tr>
                <td>Row 4, cell 1</td>
                <td>Row 4, cell 2</td>
                <td>Row 4, cell 3</td>
            </tr>
        </table>
    </body>

</html>
The table element defines the table.

The tr element defines a table row.

The td element defines a data cell. These must be enclosed in tr tags, as shown above.

tr=table row=行

td=table date cell=列元素

 

示例2

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Basic table</title>
    <style>
        td {
            border: 1px solid #999;
            padding: 0.1em 1em;
        }
    </style>
</head>
<body>
    <table>
        <tr>
            <td>Cats</td>
            <td>Dogs</td>
            <td>Lemurs</td>
        </tr>
        <tr>
            <td>Tiger</td>
            <td>Grey Wolf</td>
            <td>Indri</td>
        </tr>
        <tr>
            <td>Cheetah</td>
            <td>Cape hunting dog</td>
            <td>Sifaka</td>
        </tr>
        <tr>
            <td>Caracal</td>
            <td>Red fox</td>
            <td>Brown lemur</td>
        </tr>
        <tr>
            <td>Wildcat</td>
            <td>Fennec</td>
            <td>Dwarf lemur</td>
        </tr>
    </table>

    <!-- Link back to HTML Dog: -->
    <p><a href="http://www.htmldog.com/examples/"><img src="http://www.htmldog.com/badge1.gif" alt="HTML Dog"></a></p>
</body>
</html>

技术分享

 

HTML table元素

标签:技术   cheetah   doctype   div   alt   asi   html   example   href   

原文地址:http://www.cnblogs.com/xkxf/p/7043667.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!