I have a table (with tabular data) that I want to display on a webpage.
Initially the talbe is empty. When a user clicks on a button, a child
window opens up with a form and some text fields. Then, the user clicks
submit on this child window, closing the child and sending the information
back to the parent.
That part works.
Now, I want to have the parent window change the innerHTML of a div tag that
I have nested in the table like so...
<table>
<div id="someid"></div>
</table>
The idea is, that each time someone clicks submit from one of the children,
the content of the div gets updated... and that works too!!!
But, when I assign it like this:
myVar.innerHTML="<tr><td>data1</td><td>data2</td><td>data3</td></tr>";
the row does not appear in the table, but above it. How can I fix this?
I know I can add <table ....> and </table> to the innerHTML, but I have
column headers that show initially and I would rather avoid having all of
the table created with js.
Any help is greatly appreciated.