user6394357 user6394357 - 1 year ago 79
Javascript Question

insert row into datatable with textbox in rails application

I am trying to implement insert two text box with same row in datatable same row of searching box I am trying by following way


$(window).load(function (){
var table = document.getElementById("example");
var row = table.insertRow(0);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
cell1.innerHTML = "NEW CELL1";
cell2.innerHTML = "NEW CELL2";

but i cant to do that...plz help

Answer Source

Couldn't you just do $("#example").append("<tr><td>" + "NEW CELL1" + "</td></tr>");

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download