Jquery 如何 cellIndex

728x15 ad here

出自Guoshuang Wiki

跳转到: 导航, 搜索
//选中列效果

$("#showTable th").click(function(){

//返回在 tobody 中的序数 而不是 cellIndex 的每行
thIndex=$("#showTable th").index(this)+1;
$("#showTable tbody td").css("background","transparent");
$("#showTable tbody td:nth-child("+thIndex+")").css("background","#ccc");
})
个人工具
125x125 ad here
Advertisement
120x600 ad here