1. 程式人生 > >table中列的循環遍歷

table中列的循環遍歷

var b- apple body table -o close 這就是 -type

var index=$(this).index();

var tr=$(this).closest(‘tbody‘).children(‘tr‘);

var trList=tr.children(‘td:nth-of-type(‘+(index+1)+‘)‘);

先獲取當前的index,在獲取所有的行數,最後獲取每行所有的相同的td,這就是一列td

table中列的循環遍歷