Results 1 to 2 of 2

Thread: Table Cell Background?

  1. #1
    Join Date
    Aug 2007
    Posts
    3

    Unhappy Table Cell Background?

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    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; }
    </style>

    and this in the html markup:-
    <td class="cellbackground">cell text</td>
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •