Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stretching a table background

0 views
Skip to first unread message

Nathan Sokalski

unread,
Apr 8, 2005, 11:39:25 PM4/8/05
to
I have an image that I am using as a table background. I want the image to
be stretched to fill the entire table rather than being tiled. However, I
could not find a CSS property that allows me to do this. Does anyone have
any suggestions?
--
Nathan Sokalski
njsok...@hotmail.com
http://www.nathansokalski.com/


Adrienne

unread,
Apr 9, 2005, 10:58:07 AM4/9/05
to
Gazing into my crystal ball I observed "Nathan Sokalski"
<njsok...@hotmail.com> writing in
news:eEgP7WLP...@TK2MSFTNGP12.phx.gbl:

> I have an image that I am using as a table background. I want the image
> to be stretched to fill the entire table rather than being tiled.
> However, I could not find a CSS property that allows me to do this.
> Does anyone have any suggestions?

You can't. You can't do it with CSS and you can't do it with HTML. The
Internet is not a desktop.

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Unknown

unread,
May 21, 2005, 3:42:08 PM5/21/05
to
Nathan Sokalski wrote:

> I have an image that I am using as a table background. I want the
> image to be stretched to fill the entire table rather than being
> tiled. However, I could not find a CSS property that allows me to do
> this. Does anyone have any suggestions?

Hallo Nathan,

You can make a 'work-around' to get the effect you want quite easily
using the z-index and nesting - either with tables or with divs:

example 1:
<table style="z-index:0; position:absolute;top:5px; left: 5px;
width:500px; height:500px;">
<tr><td>
<img src="YourImageName.jpg" width="100%" height="100%" />
<div style="color:#ffffff;z-index:5; position:absolute;top:50px; left:
50px; width:auto; height:auto;">
hallo world
</div>
</td></tr></table>
</div>

example 2:
<div style="z-index:0;position:absolute;top:5px;left:5px;width:500px;
height:500px;">
<img src="YourImageName.jpg" width="100%" height="100%" />
<div style="color:#ffffff;z-index:5; position:absolute;top:50px; left:
50px; width:auto; height:auto;">
hallo world
</div>
</div>


regards
debz

0 new messages