jquery循环遍历表中的所有行,而不是第一行 [英] Jquery loop through all the rows in a table without first row
本文介绍了jquery循环遍历表中的所有行,而不是第一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在特定表格的所有行中进行循环,并按照以下方式完成。有一点,我需要删除匹配的表格行。我无法弄清楚如何跳过第一行并遍历所有其他行。我的代码循环遍历所有tr。
I need to loop through all rows for a particular table, and I have done it as below. At one point, I need to remove the matching table row. I couldn't figure out how to skip the first row and loop through all others. My code below is looping through all tr's.
$('#tbl_dynamic_call_dates > tbody > tr').each(
function() {
console.log($(this).find(\'td:first\').text());
if($.inArray($(this).find(\'td:first\').text(),array) == -1){
$(this).remove();
}
推荐答案
$('#tbl_dynamic_call_dates > tbody > tr').not(":first"). [....]
获得一切,但第一个
to get everything BUT the first
$('#tbl_dynamic_call_dates > tbody > tr:first'). [...]
或
$('#tbl_dynamic_call_dates > tbody > tr').first(). [...]
只能得到第一个
这篇关于jquery循环遍历表中的所有行,而不是第一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文