By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,493 Members | 1,920 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,493 IT Pros & Developers. It's quick & easy.

Help : How do I make the background image stretch to fit the table cell?

P: n/a
TAM
Hi,

I am using a table with height and width as 100%. I wish to use a
background image of size W 62x H 314 pixels for one table cell.

How do I make the background image stretch to fit the table cell? I do
not want the image to repeat. It should only be a single image
stretched as per size of the table.

Thanks
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
gr*******@canada.com (TAM) wrote:
I am using a table with height and width as 100%. I wish to use a
background image of size W 62x H 314 pixels for one table cell.

How do I make the background image stretch to fit the table cell?


Not possible, you could try using a foreground image and setting that to
100%, but expect problems.

--
Spartanicus
Jul 20 '05 #2

P: 1
You can use CSS. I'll explain.
First, you will have to make [HTML]<style></style>[/HTML] tags at the top.
inside these tags, you will put:
Expand|Select|Wrap|Line Numbers
  1. .whatever {background-image: url('your/image.png'); }
you can change whatever and your/image.png to whatever you want.
then what you have to do is add class to your td tag, like this.
[HTML]<td width=245 height=45 class=whatever></td>[/HTML]
(make sure you remove the background thing from the td tag as well)
and there you go. Even I've learned something today.
Jul 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.