Jump to content

Change table background image On CLICK


jonnewbie12

Recommended Posts

I am designing a PHP page in dreamweaver CS5.  I have a tabe with a background image. 

 

Is there a simple code that will allow me to change the image preferably on a hover or a click. Ideally I want to get the image from the database using echo function.  I have called the table ID "td1".

 

Table code is:

 

<table width="89%" border="0" cellpadding="0" cellspacing="2" style="background:url(graphics/colourboxcream.png) no-repeat" id="td1">

 

Please, please, help  :(

Link to comment
Share on other sites

easy to say and I am using CSS but I cant work out what the code is to change the background.  Not sure how to define the table.  Is it a get element ID or a table.id.background-image or some other code to point to the actual table?  Sorry for being a div but I know how to change the image and how to use CSS but I am having trouble trying to work out the the actual function that will change the property when clicked or hovered?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.