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

表格隔行变色-js代码

时间:2014-07-29 10:23:38      阅读:383      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   java   color   io   cti   html   

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>隔行变色</title>
<script type="text/javascript" src="jquery-1.11.0.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $("table tr:odd").css("background","red");
    });
</script>
</head>

<body>
<table border="1" width="500">
    <tr>
        <td>11</td>
        <td>12</td>
        <td>13</td>
        <td>14</td>
    </tr>
    <tr>
        <td>21</td>
        <td>22</td>
        <td>23</td>
        <td>24</td>
    </tr>
    <tr>
        <td>31</td>
        <td>32</td>
        <td>33</td>
        <td>34</td>
    </tr>
    <tr>
        <td>41</td>
        <td>42</td>
        <td>43</td>
        <td>44</td>
    </tr>
    <tr>
        <td>51</td>
        <td>52</td>
        <td>53</td>
        <td>54</td>
    </tr>
    <tr>
        <td>61</td>
        <td>62</td>
        <td>63</td>
        <td>64</td>
    </tr>
</table>

</body>
</html>

 

表格隔行变色-js代码,布布扣,bubuko.com

表格隔行变色-js代码

标签:style   blog   http   java   color   io   cti   html   

原文地址:http://www.cnblogs.com/yunmengxiaohe/p/3873681.html

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