...

View Full Version : changing background image of a table



sandeep89
12-21-2005, 04:55 PM
hi
i have the following:


<table id="table3" cellSpacing="6" width="100%" style="border: 1px solid #C2CFDF; background-color: #F0F5FA">
<tr style="font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; color: #000">
<td style="font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; color: #000">&nbsp;</td>
<td align="right" style="font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; color: #000">&nbsp;</td>
</tr>
</table>


i want to change the background image of the table to
http://img.photobucket.com/albums/v214/sandeep89/asd.png
(not a real image)

i know i need something like:
document.getElementById="table3".style.backgroundImage="url(http://img.photobucket.com/albums/v214/sandeep89/titlemedium.png)"

this doesn't work, can anyone tell me where im going wrong please?
thanks
sandeep

PhotoJoe47
12-21-2005, 05:19 PM
Your syntax is a little off.

document.getElementbyId("table3").background="the url of the image goes here"

Kor
12-21-2005, 05:37 PM
and use relative url, not absolute, as long as your picture belongs to the same domain with the page



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum