tab奇偶行颜色交替+插件
(function($){
$.fn.tableUI=function(options){
var defaults={
evenRowclass:"evenRow",
oddrowclass:"oddRow",
activeRowClass:"activeRow"
}
var options=$.extend(defaults,options);
this.each(function(){ //each历编
thistable=$(this);
thistable.find("tr:even").addClass(options.evenRowclass);
thistable.find("tr:odd").addClass(options.oddrowclass); });
//鼠标经过,离开的tr的变化
thistable.find("tr").bind("mouseenter mouseleave",function(e){
$(this).toggleClass(options.activeRow);
}); } })(jQuery);
上是tableUI.js
以下是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=gb2312" />
<title>无标题文档</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="tableUI.js"></script>
<script>
$(document).ready(function (){
$('#tbl, #tbl2').tableUI();
});
</script>
<style>
.evenRow{background-color:#FFCCCC;}
.oddRow{background-color:#CCCCCC;}
.activeRow{background-color:#CCCCFF;}
</style>
</head> <body>
<table id="tbl" style="width:400px;" border="5px">
<tr>
<td><span style="border:1px solid red; display:block;">1111111111111</span></td>
<td>1111111111111</td>
</tr>
<tr>
<td>1111111111111</td>
<td>1111111111111</td>
</tr>
<tr>
<td>1111111111111</td>
<td>1111111111111</td>
</tr>
<tr>
<td>1111111111111</td>
<td>1111111111111</td>
</tr>
</table>
</body>
</html>
tab奇偶行颜色交替+插件的更多相关文章
- 如何修改antd中表格的表头样式和奇偶行颜色交替
在做antd表格时通常会用到table组件,但是table的表头时给定的,那么怎么修改表头的颜色呢? 这里用的时less的写法,在全局环境中写,所有的table表头都会变成自己定义的颜色 定义好表头的 ...
- WPF ListView控件设置奇偶行背景色交替变换以及ListViewItem鼠标悬停动画
原文:WPF ListView控件设置奇偶行背景色交替变换以及ListViewItem鼠标悬停动画 利用WPF的ListView控件实现类似于Winform中DataGrid行背景色交替变换的效果,同 ...
- table中嵌套table,如何用jquery来控制奇偶行颜色
总是要趁着自己还有记忆的时候,把该记录下来的都记录下来,着实是不敢恭维自己的记性. 相信很多时候,我们前端人员,经常会用到table里面的某个td中还嵌套着table,而这个时候还总要去弄奇偶行的颜色 ...
- html table奇偶行颜色设置 (CSS选择器)
:nth-child(n) 选择器匹配属于其父元素的第 N 个子元素,不论元素的类型.n 可以是数字.关键词或公式. 下面的例子, 设置表格的奇偶行背景颜色不同:单独设置表格的第1列背景颜色不同. & ...
- 当鼠标经过表格数据行时颜色不同且奇偶行颜色也不同 (纯CSS)
<!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Prope ...
- js控制表格单双行颜色交替显示
<script language="JavaScript"> window.onload = function() { var Table=document.getEl ...
- flex 4 datagrid 奇偶行颜色设置
<s:DataGrid width="100%" height="100%" alternatingRowColors="[#ffFFff,#e ...
- Bootstrap table插件 被选中的行颜色改变
参考:https://www.jianshu.com/p/1bb4c37ef636 在 bootstrap-table.min.css 中修改源码 //选中行颜色 .fixed-table-conta ...
- C#/VB.NET 如何在Excel中使用条件格式设置交替行颜色
说起高亮数据行,不让人想起了交替颜色行,有的人把交替颜色行也都设置成高亮,不仅不美观,而且对阅读还是个干扰.隔行交替的颜色是为了阅读不串行,这些行只是环境,数据才是主体.那么如何通过C#/VB.NET ...
随机推荐
- stack(STL)
//Stack STL //在STL中,栈是以别的容器作为底部结构,再将 //接口改变,使之符合栈的特性 //一共5个常用操作函数 //构造析构 stack<Elem>c; //build ...
- C语言中字符串
#include <stdio.h> int main(){ char s[] = "ABCD"; char *p; for(p=s; p<s+4; p++) { ...
- informix建临时表索引
对于特殊字段,比如外键,主键,在不知道外键主键名的情况下,需要如下操作select constrname from sysconstraints where constrtype='R' and ta ...
- Andorid第三方库
博客: http://blog.csdn.net/codywangziham01/article/details/11818559#t8 RoboGuice: http://www.importnew ...
- LeetCode OJ 34. Search for a Range
Given a sorted array of integers, find the starting and ending position of a given target value. You ...
- MSXML insertBefore(IXMLDOMNode *newChild, VARIANT refChild) 传参
在xml操作中经常会用到在某一个节点后或前面插入一个节点,MSXML DOM 中使用的函数是insertBefore(IXMLDOMNode *newChild, VARIANT refChild): ...
- SharePoint 2013 字段属性之JSLink 转载来源(http://www.cnblogs.com/jianyus/p/3544482.html)
在SharePoint 2013中,SPField新增加了一个属性是JSLink,使用客户端脚本修改字段前台展示,我们可以用很多方法修改这个脚本的引用,然后来修改脚本,下面,我们举一个简单的例子. 具 ...
- Xcode中AutoLayOut的简单使用
做了一段界面最头疼的就是适配的问题了,使用AutoLayOut做适配是一个不错的选择, 自己做的一个小例子,具体如下: 一.在新建的xib文件中勾选上 autoLayout,默认是勾选上的 二.在xi ...
- bootstrap validator html attributes 选项
常用的html属性:data-fv-message="The username is not valid"data-fv-notempty="true"data ...
- lua: Learning Official Doc notes
dynamically typed vars: basic types: nil, boolean, number, string, function, userdata, thread & ...