Jquery append td

I am trying to add td after the end of the existing td. Below is the following code (I do it in jqgrid).

$("#list_toppager_center tr:first td:eq(7)").append("<td class='ui-paging-info'>Col/td>");

I see that this column is being added, but it is being added under the column that I am trying to add, instead of adding side by side. Is the above solution the right way?

+3
source share
4 answers

Something like this should hopefully help:

$(function(){
    $("#list_toppager_center tr:first td:last").after("<td class='ui-paging-info'>Col</td>");
}); 

Greetings

G.

+7
source

You are missing out <on closing </td>. I also think you want to select a row and add to it; you add a cell inside the cell, which makes the HTML invalid.

+1
source

... ( 1).

see: jQuery add HTML column

$("#list_toppager_center tr:first").append("New Col");
$("#list_toppager_center tr:gt(0)").append(" ");

0
source

Source: https://habr.com/ru/post/1785510/


All Articles