Table bgs

Discussion in 'Web Design & Coding' started by Geffy, Feb 19, 2003.

  1. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    I am tryin to put an image inside a table cell as a background, but I want the image to take up the entire size of the cell and not be repeated. So I want the image to be resized according to the dimensions of the cell. Is this possible and how can I do it
     
  2. jonifen

    jonifen pffff...

    Messages:
    705
    I know you can stop the image being repeated by including this in a stylesheet...

    TABLE
    {
    background-repeat: no-repeat;
    background-attachment: fixed;
    }

    whether or not that helps you, I dont know... but at least you've stopped it repeating if nothing else :)
     
  3. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    damn well that kinda helped, but I got one section in the table that I want to repeat and one section that I dont want to repeat
     
  4. jonifen

    jonifen pffff...

    Messages:
    705
    does this work?

    <table>
    <tr><td>
    content that u want more than one background image on
    </td></tr>
    <tr><td class="wibble">
    content that you want only one background image but stretched on
    </td></tr>
    </table>

    (replace above with your table code - including the class="wibble")


    change the stylesheet to this:

    WIBBLE
    {
    background-repeat: no-repeat;
    background-attachment: fixed;
    }


    i think that might work... been a while since i played with stylesheets so much

    also, does this work?

    background-width: 100%;
    background-height: 100%;

    not really sure - and i dont have an image to test it on.
     
  5. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    that is perfect, thnx :)

    I cant get the background-height 100%; to make the image take up the whole cell height, but I can resize images by hand for that, though if you think of anything then let me know. I think I am going to go digging through the net for CSS info.

    thnx again
     
  6. jonifen

    jonifen pffff...

    Messages:
    705