js dynamic table

 

Dynamic increase in the number of lines form with js.

 

html:

    <table>
        <thead>
            <tr>
                <td>学号</td>
                <td>姓名</td>
                <td>操作</td>
            </tr>
        </thead>
        <tbody id="body"></tbody>
    </table>
    <button onclick="add()">>Button</Add a line

 

 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

 

Guess you like

Origin www.cnblogs.com/Fourteen-Y/p/11791014.html