Results 1 to 5 of 5

Thread: Cross-browser >> Table background images

  1. #1
    Join Date
    Apr 2005
    Location
    Japan
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cross-browser >> Table background images

    Hi,

    I have a site that I have put a great deal of work into. I use NS, FF, and Opera to check the sites. However, recently, I have unconciously left IE out of the test browser mix. most likely due to personal feelings about the browser. (pretty ignorant huh?)

    Well, live and learn I guess. The table in question has data loaded from MySQL in which the number of rows is variable. In order to make the table 'fit' the data, I use background images in the rows.

    Here is the link to the test site. templates.chirowebjapan.com

    (If you use utf-8, all the question marks will be replaced with Japanese)

    Anyway, if you use anything except IE, the backgrounds appear perfectly. In IE... nothing except the 'MENU' title appears (regular foreground image) with the text barely visible due to the background color.

    The question is... Does anyone know of a workaround for this. I know sometimes a specific HTML directive such as 'transparency' for iframes will cure these problems. But, for table image backgrounds, I can't find it.

    In fact, as I write this, I'm not sure if the transparency on the nested data tables is supported.

    Any insight is appreciated.

    Thanks,
    SteedVLX

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This kind of style works with tr's and td's cross-browser:

    HTML Code:
    <tr style="background-image: url(images/banner7a.gif); background-color: rgb(255, 228, 196);">
    so does:

    Code:
    <style type="text/css">
    tr.odd {
    background:rgb(255, 228, 196) url(images/banner7a.gif);
    }
    </style>
    when used with:
    HTML Code:
    <tr class="odd">
    Which brings up the point, whenever you provide a background image, provide a background color so your text is legible even if the image doesn't load for whatever reason.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2005
    Location
    Japan
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks. That looks interesting and I'll try to implement it and see what happens.

    SteedVLX

  4. #4
    Join Date
    Apr 2005
    Location
    Japan
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well, that didn't take long...

    That works beautifully! I just stuck in the tr style for one row, and it loaded in IE nicely. I'll make all the changes tomorrow (it's 2:00am here now) and it will actually be licked.

    Thank you for that very nice little snippet.

    SteedVLX

  5. #5
    Join Date
    Apr 2005
    Location
    Japan
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    At the risk of seeming overly enthusiastic... I am starting to love CSS more and more every day...

    The changes are complete, and now all browsers just love the page.

    Thanks again for the great tip.

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
  •