473,569 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 62478
gr*******@canad a.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
nontitle
1 New Member
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
10820
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
2274
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 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
2
26112
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 code is as follows; .featured_cells { background-image:url(Images/Front_Page/featured_cells.gif); background: no-repeat bottom right;...
5
3435
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 use <td background="img src=.."></td>, what is the correct method? Some modern templates do it all with CSS, but that is getting a bit too deep for...
1
3535
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 black for example). I am dynamically creating the LinkButton controls and adding them into the table cell and I've also hooked up an event handler for...
2
12213
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"; for(int i=0; i < allRecords.Length; i++) { TableRow tRow = new TableRow(); Table2.Rows.Add(tRow); TableCell tCell1= new TableCell();...
4
6251
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 style="PADDING-LEFT:26px; PADDING-TOP:1px">Monday</div> </td> </tr> <tr>
2
3362
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
10529
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 selected row/column. It works great most of the time but sometimes the cell may have an inline style sets background colour to yellow. This, of...
0
7615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.