try something like<table id="mytable">
<tr>
<td style="width:200;height:200;background-image:url(http://www.csdn.net/csdn.gif)">Hello</td>
<td style="width:200;height:200;background-image:url(http://expert.csdn.net/images/ad/dby3_database_120.GIF)">World</td>
</tr>
</table>
<input type="button" value="swap node" onclick="mytable.rows[0].cells[0].swapNode(mytable.rows[0].cells[1])"><input type="button" value="swap node" onclick="img = mytable.rows[0].cells[0].style.backgroundImage;mytable.rows[0].cells[0].style.backgroundImage=mytable.rows[0].cells[1].style.backgroundImage;mytable.rows[0].cells[1].style.backgroundImage=img;">