JavaScript 动态表格

`

<html lang="en"> <head> <meta charset="UTF-8"> <title>动态表格</title>
<style>
    table{
        border: 1px solid;
        margin: auto;
        width: 500px;
    }

    td,th{
        text-align: center;
        border: 1px solid;
    }
    div{
        text-align: center;
        margin: 50px;
    }
</style>
<table>
    <caption>学生信息表</caption>
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>操作</th>
    </tr>

    <tr>
        <td>1</td>
        <td>令狐冲</td>
        <td>男</td>
        <td><a href="javascript:void(0);" onclick="delTr(this);">删除</a></td>
    </tr>

    <tr>
        <td>2</td>
        <td>任我行</td>
        <td>男</td>
        <td><a href="javascript:void(0);" onclick="delTr(this);">删除</a></td>
    </tr>

    <tr>
        <td>3</td>
        <td>岳不群</td>
        <td>?</td>
        <td><a href="javascript:void(0);" onclick="delTr(this);">删除</a></td>
    </tr>


</table>
`
posted @ 2021-02-26 15:38  withLevi  阅读(57)  评论(0编辑  收藏  举报