Hi,
I am trying unsuccessfully to create dynamic rows in a table by injecting html into the table.
There are a number of ways this can be done (creating object) but I must use html code.
I have created a simplified html version (below) to highlight the problem.
The problem is when I output the “rendered” html the row and cell begin tags are missing, this causes display problems.
Can anyone explain why this is happening?
Thanks in advance!!!
[code]
<html>
<body><table id=”main_table”>
<tr>
<td>cell1</td>
<td>cell2</td>
</tr>
<span id=”insert_after_here”>
</span>
</table>
<script>
var dynamicRowSpan = document.getElementById(“insert_after_here”);
dynamicRowSpan.insertAdjacentHTML(“afterEnd”,”<tr><td>cell3</td><td>cell4</td></tr>”);
var tb = document.getElementById(“main_table”);
alert(tb.outerHTML);
</script>
</body>
</html>
[/code]
————–