December 24th, 2004, 07:16 AM
How to add a Row to a table dynamically
What i have is a table(1) with some information...And another table(2) with same Header fields as the above in the same HTML page...Initially the second table is empty and the first is populated with some rows.. If i click on a row in the first table, i need that row to be added in the second table...Its all about selectig a row from one table and inserting in another table...
I traced the row object on which I clicked with 'obj= Event.srcElement' And using obj.innerHTML(it contains only TD elements) , I got all the TD elements of that row and I made a String like ( str="<tr>"+ obj.innerHTML+"</tr>" ).... Can i add this row to another table Dynamically... I tried this with (tbody.innerHTML=str) .but it does not work...Can u please help me...
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!