码迷,mamicode.com
首页 > Web开发 > 详细

jquery 表格操作

时间:2014-05-24 10:33:02      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:style   class   blog   c   code   java   

bubuko.com,布布扣
<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>
bubuko.com,布布扣

 

jquery 表格操作,布布扣,bubuko.com

jquery 表格操作

标签:style   class   blog   c   code   java   

原文地址:http://www.cnblogs.com/lierjie/p/3748440.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!