I am trying to append a td after the end of an existing td. Below is the following code (I am doing it in jqgrid).
$("#list_toppager_center tr:first td:eq(7)").append("<td class='ui-paging-info'>Col/td>");
I see that column gets added, but it gets added below the column I am trying to append to instead of adding beside. Is the above solution the right way to do it?
Something like that should help hopefully:
$(function(){
$("#list_toppager_center tr:first td:last").after("<td class='ui-paging-info'>Col</td>");
});
You are missing a < on the closing </td>. I also think you want to select the row and append to that; you are adding a cell inside of a cell, which would make invalid HTML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With