手记

<table><tr><td>表单制作加强记忆

tr 元素定义表格行,th 元素定义表头,td 元素定义表格单元。

<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>:nth-child()</title>
    <style type="text/css">
     tbody tr:nth-child(odd){
         color:orange;
     }
     tbody > tr:nth-child(even){
         color:green;
     }
     thead tr:nth-child(odd){
         background:yellow;
     }
    </style>
</head>
<body>
    <table border="1" cellspacing="0" width="200">
        <thead>
            <tr>
                <th>序号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>年纪</th>
            </tr>
        </thead>
        <tbody> 
            <tr>
                <td>1</td>
                <td>张三</td>
                <td>男</td>
                <td>12</td>
            </tr>
            <tr>
                <td>2</td>
                <td>李四</td>
                <td>女</td>
                <td>11</td>
            </tr>
            <tr>
                <td>3</td>
                <td>赵五</td>
                <td>男</td>
                <td>12</td>
            </tr>
            <tr>
                <td>4</td>
                <td>王二</td>
                <td>男</td>
                <td>12</td>
            </tr>
        </tbody>  
    </table>
</body>
</html>
1人推荐
随时随地看视频
慕课网APP