473,385 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
2 62399
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Martin Ernst | last post by:
Hello, i have a table with two rows: <TABLE> <TR> <TD ROWSPAN="2"> <IMG SRC="pics/image.jpg" width="575" height="???"> </TD> </TR>
1
by: TAM | last post by:
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...
2
by: Urbanposters | last post by:
Hi, i am hoping someone out there can help me with this, b/c i don't really know what is going on. i am working to put a background image in a cell of my table. i am using dreamweaver mx. the css...
5
by: Doug Laidlaw | last post by:
HTML validators say that "background" is not a valid attribute for a <td> tag I want to set an image as the background for one cell only, and to have the cell content on top of it. If I can't...
1
by: Thanks | last post by:
I have a routine that is called on Page_Init. It retrieves folder records from a database which I display as Link Buttons in a table cell. I set the table cell's bgcolor to a default color (say...
2
by: Manny Chohan | last post by:
i am trying to add image to table cell. Here is my code.. System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image(); img.ImageUrl="http://localhost/Lhw/Images/i.p.new.gif";...
4
by: phil2phil | last post by:
Hi, Right now I have a datalist, that renders the following html: <tr> <td class="daycss" align="Left" valign="Top" style="background-color:#EEEEEE;height:20px;"> <div...
2
by: ganesh22 | last post by:
Hi, I written a table in Script.js fille for that table i want to give background image How?
3
Frinavale
by: Frinavale | last post by:
Hi there, I'm using JavaScript to highlight a row or column in a table. I have created a CSS class that changes the background colour to a light blue and I apply this class to the cells in the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.