I’m trying to wrap a set of consecutive table rows using jQuery, but when I try to target them, it’s not finding the rows I expected it to.
$("tr.row1").next("tr:lt(4)").wrapAll("<tr class='wrapped'><td><table></table></td></tr>");
I’m not sure how to properly explain this, so please look at this example: http://jsfiddle.net/uqp6H/
Instead of wrapping row2 row3 row4 and row5, it is wrapping the next four row2’s.
This wraps from row2 to row5. (It also sets the colspan of the wrapper to 3 – if you need this).
http://jsfiddle.net/g59mg/