Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
131
rated 0 times [  134] [ 3]  / answers: 1 / hits: 24205  / 16 Years ago, mon, march 2, 2009, 12:00:00

I know how to append a new row to a table using JQuery:



var newRow = $(<tr>...</tr>);
$(#mytable tbody).append(newRow);


The question is how do I create a new row that precedes some existing row.


More From » jquery

 Answers
29
where_you_want_it.before(newRow)


or



newRow.insertBefore(where_you_want_it)


-- MarkusQ


[#99902] Wednesday, February 25, 2009, 16 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
magaly

Total Points: 524
Total Questions: 96
Total Answers: 89

Location: India
Member since Wed, Aug 26, 2020
4 Years ago
;