📄 settable.js
字号:
//Code by Jarry.Li ,CopyRight @ Jiarry.126.com,All reserved
//homepage : http://Jiarry.blogchina.com
//E-mail:jiarry@hotmail.com
//使用方法:
//setTrBg( table , 1 , 0);//1开0关;
function setTrBg(obj , thead , trbg){
if(obj == null || obj.tagName.toLowerCase() != "table") return;
trlen = obj.rows.length;
if(trlen < 0) return;
if(thead == 1){//如果是1则表示执行,重显表头;
tdlen = ( obj.rows[0].cells.length );
for( var x = 0 ; x < tdlen; x++){
var td = obj.rows[0].cells[x];
td.style.color = "";
td.style.fontSize = "14px";
td.style.fontWeight = "bold";
}
}
if(trbg == 1){//如果是1则表示执行,分隔显示tr背景;
for(var i=0; i<trlen ; i++){
if(i%2 != 0)
obj.rows[i].style.backgroundColor ="#ECECFF";
}
}
}
///设置table的背景色
function setoverbg(){
this.style.backgroundColor="blue";
}
function setoutbg(){
this.style.backgroundColor="";
}
function setOver(obj){
if(obj == null || obj.tagName.toLowerCase() != "table") return;
trlen = obj.rows.length;
if(trlen < 0) return;
for(var i=0; i<trlen ; i++){
obj.rows[i].onmouseover =function(){
setoverbg.call(this);
}
obj.rows[i].onmouseout =function(){
setoutbg.call(this);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -