Here is a snippet of my code:
JAVASCRIPT SNIPPET
***************************************
var newImage = document.createElement('img');
newImage.src = "someimage.gif";
newImage.id = "image4";
// Attach that element to appropriate div square.
var my_div = document.getElementById("square" + i);
my_div.appendChild(newImage);
HTML SNIPPET
***************************************
<table style="margin-bottom:8px" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="44px" height="44px">
<div id="square0" class="lightSquare" >
</div>
</td>
....... (many table cells with div tags within - a grid)......
</tr>
</table>
Any suggestions?