js动态表格

用js实现动态增加表格行数。

html:

    <table>
        <thead>
            <tr>
                <td>学号</td>
                <td>姓名</td>
                <td>操作</td>
            </tr>
        </thead>
        <tbody id="body"></tbody>
    </table>
    <button onclick="add()">添加一行</button>

 css:

1     <style>
2         table{
3             border: solid 1px #000000;
4         }
5         td{
6             width: 100px;
7             border: solid 1px #000000;
8         }
9     </style>
View Code

猜你喜欢

转载自www.cnblogs.com/Fourteen-Y/p/11791014.html
今日推荐