关闭

简单隔行变色

标签: javascriptxhtmljqueryborderfunctionhtml
372人阅读 评论(0) 收藏 举报
   

<!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 language="javascript" type="text/javascript" src="../../../include/jquery.js"></script>

<script language="javascript" type="text/javascript">

//使用jquery加载事件
$(document).ready(function (){
 
 $("tr:even").css("background","#ffff99");
 $("tr:odd").css("background","#cccccc");

});

 

 

</script>

 

</head>

<body>
<table width="600" border="1">
  <tr>
    <td>姓名</td>
    <td>性别</td>
    <td>年龄</td>
    <td>手机</td>
    <td>QQ</td>
  </tr>
  <tr>
    <td>哈哈</td>
    <td>女</td>
    <td>102</td>
    <td>13312344321</td>
    <td>12344321</td>
  </tr>
  <tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>
   <tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>
  <tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>

<tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>

<tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>

<tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>

<tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>

</table>
</body>
</html>

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:38622次
    • 积分:1097
    • 等级:
    • 排名:千里之外
    • 原创:73篇
    • 转载:0篇
    • 译文:0篇
    • 评论:12条
    最新评论