View Full Version : how to set image as a cell background

11-10-2006, 09:20 AM

Sorry if this Question seems trivial - I just can't work out how to do it.

How do I make an image the background for a table cell. I can import images into cells easily enough but I can't then enter text above them without the use of layers!

many thanks in advance


11-10-2006, 10:07 AM
<td background="Images/image.jpg">

you could use a CSS class to define your <td bg which would be better

11-10-2006, 11:52 AM
Thanks for that - it is exactly what I couldn't do.

The only issue with it is that Dreamweaver tiles the picture I choose. So instead of getting a single sample I get a multitude

How do you keep the image to a single occurance?

11-10-2006, 12:29 PM
Yeah, use CSS to do this as the td background image property isnt XHTML 1.0 complient (its a Microsoft thing) and wont be seen in some (most) browsers.

Just make a new CSS property in dreamweaver, goto Background, set a background image and set it no tile X or Y etc...

<style type="text/css">
.tdBgImage {
background-attachment: scroll;
background-image: url(../image.jpg);
background-repeat: no-repeat;

Table cell
<td class="tdBgImage">stuff inside the table cell here</td>

11-10-2006, 12:37 PM
Just make sure you don't call an image with specifying the C drive as the location ;)

11-10-2006, 12:39 PM
thanks guys - I 've got the CSS version working absolutely fine

Thank You