tags:

views:

291

answers:

1

I'm using jQuery along with the tablesorter plugin to sort a table. Everything is fantastic, but I'd like to insert a few rows ever 5 or so rows, and have those stay in that position, no matter how the table is sorted.

I've searched around on google, and have found nothing. I was thinking perhaps using a hidden table row along with a forced sort, but I'm not sure what I'd put into row, or how I'd sort it (ascending vs. descending)

A: 

After you do your sort, loop through the table and insert a new row every 5 rows. Make sure to give these new rows a class name. Then, before you re-sort, remove all the rows you previously inserted, sort the table, then re-insert those rows.

Matt Bridges