Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inserting new table row after the first table row using JQuery

Tags:

jquery

I have a table with id="#table" and then the first row with id="headings", now directy after the heading row I need to insert a new row

I use the following code

$("#headings").after($("#table").prepend("<tr>...</tr>"));

but I think I'm doing something wrong here

like image 297
Elitmiar Avatar asked Dec 01 '22 03:12

Elitmiar


1 Answers

Maybe $("#table tr:first").after("<tr><td>some</td><td>content</tr></tr>"); may be easier? Here's demo.

like image 150
shybovycha Avatar answered Dec 04 '22 06:12

shybovycha