zoukankan      html  css  js  c++  java
  • jquery 表格操作

    <title></title>
        <script src="jquery-1.8.3.js"></script>
        <script>
            $(function () {
                $('#tb tr:eq(0)').css({ "background-color": "gray", "height": "60px" });
                $('#tb tr:not(:eq(0)):odd').css("background-color", "yellow");
                $('#tb tr:not(:eq(0)):even').css("background-color", "green");
                var bg;
                $('#tb tr:not(:eq(0))').hover(function () {
                    bg = $(this).css("background-color");
    
                    $(this).css("background-color", "red");
                }, function () {
                        $(this).css("background-color", bg);
                })
            })
    
        </script>
    </head>
    <body>
        <table border="1" id="tb">
            <tr>
                <th>adfafa</th>
                <th>adfadf</th>
                <th>adfadf</th>
                <th>adfadf</th>
                <th>adfadf</th>
                <th>adfadf</th>
            </tr>
            <tr>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
            </tr>
            <tr>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
            </tr>
            <tr>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
            </tr>
            <tr>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
            </tr>
            <tr>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
                <td>a</td>
            </tr>
    
        </table>
    </body>
    </html>
  • 相关阅读:
    左右布局,中分线可以左右拖动
    ES6
    nodeclub route
    nodeclub models
    mybatis中sql语句查询操作
    mybatis开发dao的方式
    Mybatis框架入门
    Maven
    Android开发-ADT Bundle安装
    人类史一览
  • 原文地址:https://www.cnblogs.com/lierjie/p/3748440.html
Copyright © 2011-2022 走看看