Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Picture as Table Background 1

Status
Not open for further replies.

Bignewbie

Programmer
Feb 22, 2001
351
PH
Hi guys!

is there any way to center (without tiling) an image set as background for a table? better yet, is it possible to stretch it to fill the whole table (again, without tiling it). I hope to hear from you soon, I know this is kinda of impossible, but I just asked in case any of you was given this grimly impossible task by your boss (just like what happended to me earlier today, sheessh!). Thanks and I do hope you all reply . . .



biggie (feeling so little and helpless with my current task)
 
Hi,

To stretch the image simple specify both with and height as 100%, this will distort the image however.

To place it centrally without tiling you can use:

.specialtable {
background: #ffffff url("image.gif");
background-position: center;
background-repeat: no-repeat;
}

<table class=&quot;specialtable&quot;>
...

This make sense?


::
 
Thanks for the immediate reply. I have tried the css code and it works! now my only problem is stretching the centered background image of the table so that it will fill the entire table (however distorted and ugly it will be!) the width=100% and height=100% doesnt seem to work. Im not sure if the way i set it is correct:

.specialtable {
background: #ffffff url(&quot;/images/ucbar7.gif&quot;);
background-position: center;
background-repeat: no-repeat;
background-width: 100%;
background-height: 100%;
}


but i set the width and height of the table to 100%


any more ideas? I think we are getting warm, since centering the background image is now ok...

keep it coming guys, please!


respectfully yours,

biggie (a lot less gloomy than before, but not off the hook yet!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top