http://franca.exofire.net/jq/colorize
Coloriza 是一个Jquery 插件,可以为表格的行添加背景颜色,鼠标动作后为行、列增加高亮效果。你可以为很多行、列填色,只要你愿意。再从点击已经填色的行、列就可以还原表格本色。
怎么使用?
使用默认设置(colorizes a row)
$(‘#yourTableId’).colorize() ;
其他设置和参数:
altColor : alternate row background color. The default is ‘#ECF6FC’, ‘none’ can be used for no alternate background color.交替行的背景颜色。默认值为’#ECF6FC’,’none’ 可替代的背景颜色使用。
bgColor : background color (The default background color is white).背景颜色(默认背景颜色为白色)。
hoverColor : background color when you hover a mouse over a row. The default is ‘#BCD4EC’.背景颜色当鼠标经过行。默认值为’#BCD4EC’。
hoverClass: style class for mouseover; takes precedence over hoverColor property为鼠标经过样式类;hoverColor优先
hiliteColor : row highlight color. The default color is ‘yellow’. ‘none’ can be used to disable highlighting.行高亮颜色。默认的颜色是’黄色’。 ‘none’可以用来取消高亮。
hiliteClass : style class to be used to highlight a row or a column, takes precedence over the hiliteColor setting.样式类可用于强调一行或一列,hiliteColor设置优先。
columns : true/false/’hover’/’rowHover’ – 默认 ‘false’. 如果 ‘true’,列高亮. 如果是 ‘hover’, a column is highlighted on mouseover鼠标经过时列高亮, but does not respond to clicking但是点击没有效果. 相反, a row is highlighted when clicked一行被点击时候高亮. 如果是 ‘rowHover’, a row is highlighted on mouseover鼠标经过时行高亮, and a column is highlighted on click点击后列高亮.
oneClick : true/false – Allows only one row or column to be highlighted at a time. A click on a new row/column cancels the current highlight. The default is false.true/false-只允许一行或一列加以高亮每次。点击新行/列取消当前的高亮效果。默认值为false。
banColumns :[]- Prevents certain columns from being highlighted when clicked, and also on mouseover. Supply an array of column indices as an argument. A value of ‘last’ can be used to ban the last column.可以实现被点击或鼠标经过时某些列不高亮 ,提供一个数组作为参数列指数。值为’last’可以用来禁止的最后一列。
banDataClick :true/false – If true, you can only click on table header rows. The default is false.如果‘true’,你只能点击表格标题行。默认值为false。
ignoreHeaders :true/false – If true, header rows are not colorized. (no striping). The default is true.如果‘true’,头行不彩色。 (不分段)。默认值为true。
nested :true/false . The default is false. Use it for more consistent striping if a table contains nested tables.默认值为false。使用更一致的条带,如果一个表包含嵌套表。
示例:
The order of parameters is not important.
$(‘#yourTableId’).colorize({bgColor:’#EAF6CC’, hoverColor:’green’, hiliteColor:’red’});
$(‘#yourTableId’).colorize({ oneClick:true});
$(‘#yourTableId’).colorize({columns:true, banColumns :[0,1]});
$(‘#yourTableId’).colorize({ hiliteClass:’myStyle’});
没有高亮:
$(‘#yourTableId’).colorize( { hiliteColor:’none’ } );
Jquery Colorize Plugin Demo
http://franca.exofire.net/jq/colorize
Coloriza 是一个Jquery 插件,可以为表格的行添加背景颜色,鼠标动作后为行、列增加高亮效果。你可以为很多行、列填色,只要你愿意。再从点击已经填色的行、列就可以还原表格本色。
怎么使用?
使用默认设置(colorizes a row)
$(‘#yourTableId’).colorize() ;
其他设置和参数:
altColor : alternate row background color. The default is ‘#ECF6FC’, ‘none’ can be used for no alternate background color.交替行的背景颜色。默认值为’#ECF6FC’,’none’ 可替代的背景颜色使用。
bgColor : background color (The default background color is white).背景颜色(默认背景颜色为白色)。
hoverColor : background color when you hover a mouse over a row. The default is ‘#BCD4EC’.背景颜色当鼠标经过行。默认值为’#BCD4EC’。
hoverClass: style class for mouseover; takes precedence over hoverColor property为鼠标经过样式类;hoverColor优先
hiliteColor : row highlight color. The default color is ‘yellow’. ‘none’ can be used to disable highlighting.行高亮颜色。默认的颜色是’黄色’。 ‘none’可以用来取消高亮。
hiliteClass : style class to be used to highlight a row or a column, takes precedence over the hiliteColor setting.样式类可用于强调一行或一列,hiliteColor设置优先。
columns : true/false/’hover’/’rowHover’ – 默认 ‘false’. 如果 ‘true’,列高亮. 如果是 ‘hover’, a column is highlighted on mouseover鼠标经过时列高亮, but does not respond to clicking但是点击没有效果. 相反, a row is highlighted when clicked一行被点击时候高亮. 如果是 ‘rowHover’, a row is highlighted on mouseover鼠标经过时行高亮, and a column is highlighted on click点击后列高亮.
oneClick : true/false – Allows only one row or column to be highlighted at a time. A click on a new row/column cancels the current highlight. The default is false.true/false-只允许一行或一列加以高亮每次。点击新行/列取消当前的高亮效果。默认值为false。
banColumns :[]- Prevents certain columns from being highlighted when clicked, and also on mouseover. Supply an array of column indices as an argument. A value of ‘last’ can be used to ban the last column.可以实现被点击或鼠标经过时某些列不高亮 ,提供一个数组作为参数列指数。值为’last’可以用来禁止的最后一列。
banDataClick :true/false – If true, you can only click on table header rows. The default is false.如果‘true’,你只能点击表格标题行。默认值为false。
ignoreHeaders :true/false – If true, header rows are not colorized. (no striping). The default is true.如果‘true’,头行不彩色。 (不分段)。默认值为true。
nested :true/false . The default is false. Use it for more consistent striping if a table contains nested tables.默认值为false。使用更一致的条带,如果一个表包含嵌套表。
示例:
The order of parameters is not important.
$(‘#yourTableId’).colorize({bgColor:’#EAF6CC’, hoverColor:’green’, hiliteColor:’red’});
$(‘#yourTableId’).colorize({ oneClick:true});
$(‘#yourTableId’).colorize({columns:true, banColumns :[0,1]});
$(‘#yourTableId’).colorize({ hiliteClass:’myStyle’});
没有高亮:
$(‘#yourTableId’).colorize( { hiliteColor:’none’ } );
默认设置:
$('#tbl1').colorize();
点击后行高亮。
project_number | cost_planned | cost_actual | computed | sch_plan | sch_actual | effort_plan | effort_actual | scope_plan | scope_act |
---|---|---|---|---|---|---|---|---|---|
0101 | 10 | 20 | 70 | 20 | 0 | 0 | 0 | 0 | |
0102 | 12 | 34 | 55 | 555 | 55 | ||||
0104 | |||||||||
0149 | |||||||||
0150 | 310000 | 310000 | 0 | 3000 | 2923 | 400 | 391 | 219 | 219 |
0151 | |||||||||
0152 | 305250 | 0 | -1 | 2493 | 2056 | 121 | 121 | 14 | 14 |
0153 | 764800 | 719107 | 0 | 6078 | 5751 | 209 | 225 | 14 | 18 |
0155 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
0167 | 236000 | 54360 | 0 | 8647 | 10105 | 258 | 320 | 78 | 92 |
Jquery Colorize Plugin Demo – Colorizes Columns
Shows how to use the plugin to colorize columns:
$('#tbl1').colorize( {columns:true, oneClick:true} );
.
Every new click defaults the current highlighted column back to the orginal background color.
project_number | cost_planned | cost_actual | computed | sch_plan | sch_actual | effort_plan | effort_actual | scope_plan | scope_act |
---|---|---|---|---|---|---|---|---|---|
0101 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
0149 | |||||||||
0150 | 310000 | 310000 | 0 | 3000 | 2923 | 400 | 391 | 219 | 219 |
0151 | |||||||||
0152 | 305250 | 0 | -1 | 2493 | 2056 | 121 | 121 | 14 | 14 |
0153 | 764800 | 719107 | 0 | 6078 | 5751 | 209 | 225 | 14 | 18 |
0163 | |||||||||
0167 | 236000 | 54360 | 0 | 8647 | 10105 | 258 | 320 | 78 | 92 |
0167 | 236000 | 54360 | 0 | 8647 | 10105 | 258 | 320 | 78 | 92 |
0152 | 305250 | 0 | -1 | 2493 | 2056 | 121 | 121 | 14 | 14 |
0152 | 305250 | 0 | -1 | 2493 | 2056 | 121 | 121 | 14 | 14 |
0156 | 305250 | 0 | -1 | 2493 | 2056 | 121 | 121 | 14 | 14 |
Comments
272 responses to “Jquery 表格上色插件”