Background image in a <TR> doesnt work in IE!

Discussion in 'HTML & Website Design' started by visualkreations, Jul 28, 2008.

  1. #1
    I'm have a problem with a background image in a table with IE , it
    works with FF :
    I have a table, the <tr> has a background image, but the background repeats in each <td>
     
    visualkreations, Jul 28, 2008 IP
  2. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You'll need to show more code. IE does of course have issues styling tables. But that's cause it's stupid. But we prolly can't help you until we see what you've got.

    Your code is of course valid and has a doctype and all that jazz?
     
    Stomme poes, Jul 29, 2008 IP
  3. visualkreations

    visualkreations Well-Known Member

    Messages:
    454
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #3
    This is the code:


    <table width="500" height="143" border="0" cellpadding="10" cellspacing="0">
    <tr style="background:url(http://www.google.ca/intl/en_ca/images/logo.gif) no-repeat bottom">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    </table>
     
    visualkreations, Jul 29, 2008 IP
  4. cakung

    cakung Peon

    Messages:
    113
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    IE is stupid.....

    try with FF please :)
     
    cakung, Jul 29, 2008 IP
  5. visualkreations

    visualkreations Well-Known Member

    Messages:
    454
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #5
    it works fine in FF , but i need it in IE as well
     
    visualkreations, Jul 29, 2008 IP
  6. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #6
    you shouldn't really be using background images to tables...
     
    twistedspikes, Jul 29, 2008 IP
  7. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hmmm... I've been trying to find anything out there about IE... I've certainly run into problems, not with background colours but certainly with borders on tr's... I'm prolly going to have to try adding a background to one of my tables and experiment a bit.

    *edit okay best I've found is that some people take the image, give it to the td's and set the background-position a bit different for each td, faking the look of a single continuous background on the tr. Earlier, Opera and Safari also didn't comply here, but they do now (maybe IE8 will too?). I don't know if sticking the background on the table itself is an option for you.

    Setting different background positions means each of the td's has a different class (someone was going to try with "col" but I remember that one doesn't style the same cross-browser and I thought FF ignored it completely?). However I dunno if your td's are a set width or not. If they are a set width, you can repeat different parts of the same background in each td.
     
    Stomme poes, Jul 29, 2008 IP
  8. nirmala.prc

    nirmala.prc Active Member

    Messages:
    329
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #8
    Hi,

    You can try table background instead of tr background. Also, you can position bg image to set exactly at TR position.

    Best Regards,

    Nirmal
     
    nirmala.prc, Jul 30, 2008 IP