I have a large table of data (that displays test data) that is separated by date. I sort this data POST-processing using JQuery (the table is built in Perl and sorting really can’t be done there). After this data is sorted by date, I would like to add a separating line between each day.
For instance, I’d like the five test runs from June 5th, followed by a blank line (a blank “tr”, which will have data added to it later but that’s not important here), followed by the June 4th runs, then a blank line, then the June 3rd runs, etc.
Here is a sample of a table I have: http://jsfiddle.net/pyUz8/1/
Here is the pseudocode I have, just not sure how to do this in JQuery:
now = thisDate.substring(0,10) //Look at only the date, the time
doesn’t matter then = previousDate.substring(0,10)If (then != now) insert(
"<tr></tr>"); //inbetween then and now
How can this be done in JQuery?
run through each row, compare current date with next date, insert a tr after the current row if dates differ. Something like this: