SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2000
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do I make them so that they stay centered and don't repeat themselves.

  2. #2
    SitePoint Enthusiast swoosh's Avatar
    Join Date
    Aug 2000
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Centered and Not Tiled Cell Background

    cisites, I think stylesheets can do that for you. If I remember right, the code for doing such a thing is something like this:
    Code:
    <td style="background-position: center;
    background-repeat: no-repeat;
    background-image: url(imageLocationHere)">
    Your Cell Content Goes Here
    </td>
    The 'background-position: center' property will set it center both horizontal and vertical while the 'background-repeat: no-repeat' property will not tile your background. Remember to replace 'imageLocationHere' with the URL (or relative address) for your background image and you're all set.

    You might also want to consider using the following code if you want all your cells' background want to be centered and not tiled:
    Code:
    <style type="text/css">
    TD {
    background-position: center;
    background-repeat: no-repeat;
    }
    </style>
    Put it somewhere beetween your <head> and </head> tags. You can specify each cell's background image. If you want all of your cells to have the same background image, just add this line to the above code:
    background-image: url(imageLocationHere);

    Hope it works. I haven't tried it yet, but it should work.

    Let me know if there's something you're not clear of or if you need further assistance.

    Good luck.

    [Edited by swoosh on 10-14-2000 at 10:53 PM]

  3. #3
    SitePoint Guru
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you talking about using just one background image for the table instead of having the image repeat in every cell?

    The solution is simple, just set as the background of each cell a transparent gif, either using the traditional method or CSS.

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2000
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I have a background image that should fill up 90% of one cell. It strated to repeat, hence the question. I'll try what swoosh said and see if it works.

  5. #5
    SitePoint Enthusiast swoosh's Avatar
    Join Date
    Aug 2000
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Let me know if it work just like you wanted, cisites.

  6. #6
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Or edit the background image to fill the cell ;o


Bookmarks

Posting Permissions

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