View Full Version : Table Cell Background?

07 Sep 2007, 01:26 PM
Hello all-

I'm trying to apply a background Image to a table. I have a table made in Dreamweaver with two cells (two rows). I want the bottom cell to have a non-repeating image. This can be done by using the property inspector but there is no option to have it so it doesn't repeat. So I tried applying the background image using CSS (CSS -> New --> Table, Body, This document only). That works because there is a "no-repeat option". But that applies the background to both cells in the table AND every table I create after that.

Any idea what I can do here? I'm new with dreamweaver so please be specific.

Thank You

08 Sep 2007, 04:37 AM
I don't use dreamweaver but you should be able to insert code into one cell to control the no-repeat.

There are several ways but here are two:-
Put the background directly into the cell, rather than in the table as a whole:-
<td style="background-image: url(image.jpg); background-repeat: no-repeat;">cell text</td>

See http://www.w3schools.com/css/pr_background-repeat.asp

Or create a class for the td cell(s) if you want more than one to have the background:-

Put this inside the head section:-

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

and this in the html markup:-
<td class="cellbackground">cell text</td>