• 表格展开和关闭


    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>表格展开和关闭</title>
    <script src="jquery-1.4.2.js"></script>
    <script type="text/javascript">
    $(function(){

    $("tbody>tr.parent").addClass("even");
    $("tr.parent").click(function(){
    $(this).toggleClass("selected")
    .siblings(".child_"+this.id).toggle();
    });

    });
    </script>
    <style>
    .odd{background:#eee;}
    .even{background:#999;}
    .selected{background:red;}
    </style>

    </head>

    <body>
    <table border="1" cellpadding="0" cellspacing="0" width="100%">
    <thead>
    <tr>
    <th width="30%">姓名</th><th width="30%">性别</th><th width="40%">暂住地</th>
    </tr>
    </thead>
    <tbody>
    <tr class="parent" id="row_01">
    <td colspan="3">前台设计组</td>
    </tr>
    <tr class="child_row_01">
    <td>张三</td><td>男</td><td>浙江宁波</td>
    </tr>
    <tr class="child_row_01">
    <td>李四</td><td>女</td><td>浙江杭州</td>
    </tr>
    <tr class="parent" id="row_02">
    <td colspan="3">前台开发组</td>
    </tr>
    <tr class="child_row_02">
    <td>王五</td><td>男</td><td>湖南长沙</td>
    </tr>
    <tr class="child_row_02">
    <td>赵六</td><td>女</td><td>湖南耒阳</td>
    </tr>
    <tr class="parent" id="row_03">
    <td colspan="3">后台开发组</td>
    </tr>
    <tr class="child_row_03">
    <td>谢七</td><td>男</td><td>上海</td>
    </tr>
    <tr class="child_row_03">
    <td>小八</td><td>女</td><td>北京</td>
    </tr>
    </tbody>
    </table>
    </body>
    </html>

  • 相关阅读:
    Maven3-依赖
    Maven2-坐标
    使用VS Code开发Python
    WinDbg调试分析 asp.net站点 CPU100%问题
    asp.net core2 Centos上配置守护服务(Supervisor)
    asp.net core2部署到Centos上
    IntelliJ Error:Abnormal build process termination
    EF架构~codeFirst从初始化到数据库迁移
    office web apps 实现Wopi预览编辑
    office web apps安装教程
  • 原文地址:https://www.cnblogs.com/ll-taj/p/5825280.html
Copyright © 2020-2023  润新知