A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [RESOLVED] Image and color in table cell

  1. #1
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546

    [RESOLVED] Image and color in table cell

    First of all, something more about the title, so you don't think "that's such a n00b question" ...
    I know how to make a cell have a background image and a color which is only shown when the image isn't loaded, but that's not what I want.

    I'm constructing a website for someone and he wants to have the cells have a background gradient (333333 -> 999999) and I've made a .png for that, but I've also got some bigger cells (in lenght) than the picture, so I get a grey zone underneath.
    I've searched the internet for some code to have a background image on the top of a cell and a color which also continues underneath the picture when more text is added. And I found some and used it, but the one I'm working for didn't like it so I deleted everything.

    Now, after a week, he decides to use the code after all ... But I don't have it anymore.
    I've just been searching for over 3 hours but I haven't found it anywhere.

    Does anyone know who this can be done? I remember that everything was done within the <td> tags, so without any CSS.

    Or if anyone knows another way to do this, let me know!

    Florian
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

  2. #2
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    Ok, maybe it's just something you can't think of that fast ... The solution seemed very simple though, even for me!

    Maybe I can provide the cell with a fixed background and hight and add a scrollbar to that cell?

    Can someone help with coding that?
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

  3. #3
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    cant you just do it with css? set the background-color and the background-image? and for the scrollbar thing, you just need to set the height and width with css, then set the overflow property to auto

  4. #4
    Retired Mod aversion's Avatar
    Join Date
    Jun 2000
    Location
    insomnia
    Posts
    7,917
    I don't know about doing it without CSS but with CSS it's easy, if I'm understanding what you're asking.

    Here's an example, View here. The image I used is this one.

    This is the only important bit of the CSS:

    Code:
    td {
    	background: #999 url(bgfade.png) repeat-x left top;
    }
    This just says make the bg #999 (shorthand for #999999), make the background image bgfade.png, repeat this image horizontally only and align it to the left and top.

    The background image is 100pixels high, any table cell longer than that is displaying the background colour I set.
    Last edited by aversion; 01-03-2007 at 09:34 AM.

  5. #5
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    That exactly what I need
    Thanks a lot!
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center