Q: Dynamically Add  to tables using prototype/scriptaculous i'm trying to add 's to a table dynamically with prototype/scriptaculous. I tried doing something like this...
function test(){

    $('td1').update('<td><img src="Images/Artists/2/111.jpg" height="444" style="border:1px solid #FFFFFF;" /></td><td><img src="Images/spacer.gif" width="10" /></td>');

}

    <div id="td1">
    <td><a href="#" onClick="test(); return false;"><img src="images/viewMore.gif" height="446" border="0" /></a></td>
    </div>

and when i click on the test() function, it replaces that  with other ones. This isn't working for some reason. Can you please give me a hand in figureing this out. Thanks all!!

A: The problem is that you can't use a <div> tag inside a table like that. You're going to have to either replace each <td> individually, or merge the two <td> tags into one <td> tag. For a simple but sloppy route, you could assign an ID to both <td> tags and replace them like this:
$('td1').update('<img src="Images/Artists/2/111.jpg" height="444" style="border:1px solid #FFFFFF;" />');
$('td2').update('<img src="Images/spacer.gif" width="10" />');

Update:
After you clarified your question in the comments, what you need to do is use insert() instead of update().  insert() will append data to the end of the tag, whereas update() simply replaces it all.
