简体   繁体   中英

how to append a cell to a table row in js jquery

$("#requesttable").append("<center><legend><h2>Remote Stop</h2></legend></center><tr><td><B>Transaction ID</B></td><td><input id='transactionIdremtestop' class='easyui-textbox' name='transactionIdremtestop' style='width:200px;'></td></tr>");

我必须将此代码附加到javascript中。

This part is working but html textbox is showing instead of 'easyui-textbox'..how can i make it..to show easyui textbox

If I am getting you right, it's just the double quotes that's bothering you. Though I am not sure it works, I am just modifying your own code here:

$("#canclresv").append('<center><legend><h2>Cancel Reservation</h2></legend></center><tr><td><input id="keygetconfig" class="easyui-textbox" name="keygetconfig" style="width:200px;"></td></tr>');

give an id to the table like id="table" then

  document.getElementById("table").rows[0].insertCell(-1).innerHTML +="whatever you want"; 

if you want to insert in an already existing cell just use:

  document.getElementById("table").rows[0].cells[index].innerHTML ="whatever you want"; 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM