<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>表格隔行换色和鼠标经过高亮</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="<%=basePath%>js/jquery-1.8.2.js"></script>
<script type="text/javascript" >
$(document).ready(function() {
$(".stripe tr").mouseover(function() {
$(this).addClass("over");
}).mouseout(function() {
$(this).removeClass("over");
});
$(".stripe tr:even").addClass("alt");
}
)
</script>
<style type="text/css">
/*注意选择器的层叠关系*/
th {
background:#0066FF;
color:#FFFFFF;
line-height:20px;
height:30px;
}
td {
padding:6px 11px;
border-bottom:1px solid #95bce2;
vertical-align:top;
text-align:center;
}
td * {
padding:6px 11px;
}
tr.alt td {
background:#ecf6fc; /*这行将给所有的tr加上背景色*/
}
tr.over td {
background:#bcd4ec; /*这个将是鼠标高亮行的背景色*/
}
</style>
</head>
<body>
<table class="stripe" width="50%" border="0" cellspacing="0"
cellpadding="0">
<!--用class="stripe"来标识需要使用该效果的表格-->
<thead>
<tr>
<th>姓名</th>
<th>年龄</th>
<th>QQ</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<tr>
<td>陈增鹏</td>
<td>24</td>
<td>47353327</td>
<td>chenzengpeng@hotmail.com</td>
</tr>
<tr>
<td>吴捷康</td>
<td>25</td>
<td>376002533</td>
<td>wujiekangyun@126.com</td>
</tr>
<tr>
<td>蓝舜瀚</td>
<td>25</td>
<td>530302367</td>
<td>lanshunhan@gmail.com</td>
</tr>
<tr>
<td>许境</td>
<td>23</td>
<td>31540205</td>
<td>gl.deng@gmail.com</td>
</tr>
<tr>
<td>邓国梁</td>
<td>23</td>
<td>31540205</td>
<td>gl.deng@gmail.com</td>
</tr>
<tr>
<td>邓国梁</td>
<td>23</td>
<td>31540205</td>
<td>gl.deng@gmail.com</td>
</tr>
</tbody>
</table>
</body>
</html>
分享到:
相关推荐
jquery表格隔行变色鼠标滑过竖直表格内容变色效果
主要介绍了jQuery插件实现表格隔行变色及鼠标滑过高亮显示效果代码,涉及jQuery针对页面元素动态操作及响应鼠标事件动态修改页面元素样式的相关技巧,需要的朋友可以参考下
jquery选取商品隔行变色
jquery实现表格隔行换色和鼠标经过提示效果源码
本文实例讲述了jQuery实现Table表格隔行变色及高亮显示当前选择行效果。分享给大家供大家参考,具体如下: 最近客户要求高亮选择列表的功能,于是顺便做了个,作为记录。 前台代码: <!DOCTYPE ...
jquery隔行换色和鼠标经过样式
jquery table ui插件制作css表格隔行变色特效代码
网页中表格隔行颜色变化 jquery 表格换色 网页中表格隔行颜色变化 jquery 表格换色 网页中表格隔行颜色变化 jquery 表格换色 网页中表格隔行颜色变化 jquery 表格换色
jQuery动态生成隔行变色的table,使用jQuery+css+json实现
jQuery 图片特效,鼠标经过图标高亮显示
jquery隔行换色和鼠标经过样式和标题提示效果
主要介绍了JS与jQuery实现隔行变色的方法,结合实例形式对比分析了javascript与jQuery实现隔行变色的具体操作步骤与相关技巧,体验一下jQuery的华丽与简洁,需要的朋友可以参考下
jquery table鼠标滑过隔行变色表格样式代码
一天搞定jQuery(二)——使用jQuery表格的隔行换色
jquery表格变色jquery表格变色jquery表格变色jquery表格变色jquery表格变色jquery表格变色jquery表格变色jquery表格变色jquery表格变色jquery表格变色jquery表格变色jquery表格变色
本文实例讲述了JavaScript表格隔行变色和Tab标签页特效。分享给大家供大家参考,具体如下: 最近一直在看JavaScript知识,偶尔也穿插一点Jquery,感觉Jquery用起来真爽,减少了很多的代码量,而且学习也不是很高。接...
下面小编就为大家带来一篇jQuery轻松实现表格的隔行变色和点击行变色的实例代码。小编觉得挺不错的,现在分享给大家,也给大家做个参考,一起跟随小编过来看看吧
用JQuery实现表格隔行变色和突出显示当前行的代码,需要的朋友可以参考下
Demo2--隔行,滑动,点击 变色.+ 多选框选中的行 变色.