Stretch a <TABLE> background image to fill the entire cell

W

Water Cooler v2

I want to stretch the image so that it fills the entire cell width and
height. How do I do that?

<TD background="bg.gif" width="100%" height="100%"
style="background-repeat: no-repeat;">


So far I have done that but it doesn't seem to work. I think the height
and width get applied to the cell instead of the image. Is there a way
around this?
 
D

David Dorward

Water said:
I want to stretch the image so that it fills the entire cell width and
height. How do I do that?

You asked this in alt.html. Please don't multipost.
 
A

Andrew Murray

Make the image used as the background big enough to start with, in your
image editor. That way it won't be a 'tiled' background.

Note some of those attributes might be browser specific - some browsers
don't even support cell background images (or didn't used to anyway).

Please don't multi-post, I have a hell of a time deleting those groups I
don't subscribe to.
 
V

VidTheKid

Water said:
I want to stretch the image so that it fills the entire cell width and
height. How do I do that?

<TD background="bg.gif" width="100%" height="100%"
style="background-repeat: no-repeat;">

So far I have done that but it doesn't seem to work. I think the height
and width get applied to the cell instead of the image. Is there a way
around this?

Not yet, at least not directly as you asked it. Stay tuned for CSS 3.
Or, rather than making it a background image, maybe it can be an IMG
element inside of an absolutely-positioned DIV set to be "behind" the
cell's contents or something. But I don't know a whole lot about
layering things that way.
 
A

Andrew Murray

make the image larger than the dimensions of the cell. That way only one
"tile" will show.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top