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");
})
