Reputation: 148524
How can I select:
I've tried:
var tbl = grd.find("tr:gt(0)").find("tr:not(:has(table)");
But this doesn't return any rows.
Upvotes: 2
Views: 142
Reputation: 102745
You can use this selector:
var tbl = $("tr:not(:has(table)):not(:first)", grd);
Demo: http://jsfiddle.net/ZHTDq/
This selects rows in the tables that are <td>
descendants as well, not sure if that's in your requirements or not.
Upvotes: 0
Reputation:
This assumes you're targeting the rows of the outermost table
element.
$('#mytable > tbody > tr').slice(1)
.filter('tr:not(:has(table))');
Or if grd
is the outer table...
grd.children()
.children()
.slice(1)
.filter('tr:not(:has(table))');
Upvotes: 2
Reputation: 140220
grd.find("tr").slice(1).filter( function(){
return !this.getElementsByTagName("table").length;
});
This is pretty reliant on whatever grd
is.
Upvotes: 1