IT Community - Software Programming, Web Development and Technical Support

How to set background image for <td> using style property?

This is a discussion on How to set background image for <td> using style property? within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi, We can set background for <td> using the following codes, <td style="background-image:url(...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 01-24-2008, 04:50 AM
poornima poornima is offline
D-Web Sr.Programmer
 
Join Date: Dec 2007
Posts: 188
poornima is on a distinguished road
Smile How to set background image for <td> using style property?

Hi,
We can set background for <td> using the following codes,

<td style="background-image:url(images/img_arrow.gif)"></td>
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 01-24-2008, 09:19 AM
ammulu ammulu is offline
D-Web Programmer
 
Join Date: Dec 2007
Posts: 99
ammulu is on a distinguished road
Default Re: How to set background image for <td> using style property?

Hi Poornima,
Check out the following links :
HTML Tutorial - Background
<td> with background image - what's the right way? - HTML
Hope it helps.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 01-25-2008, 12:58 AM
poornima poornima is offline
D-Web Sr.Programmer
 
Join Date: Dec 2007
Posts: 188
poornima is on a distinguished road
Smile Re: How to set background image for <td> using style property?

Hi ammulu,
Thanks for your reply.There are many ways to set image for <td> but in some browsers it won't work.It some cases it will be displayed as error in errorlist.The best way is to use the style property of <td> to set background image.It you didn't specify url it won't works.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 01-25-2008, 01:30 AM
Sathish Kumar Sathish Kumar is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 303
Sathish Kumar is on a distinguished road
Thumbs up Re: How to set background image for <td> using style property?

Hi,
Yep you are right.I hope
<td background-image="images/1.gif" width="200"> this must work
__________________
Sathish Kumar.R
Knowledge is meant to SHARE
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 01-25-2008, 01:35 AM
poornima poornima is offline
D-Web Sr.Programmer
 
Join Date: Dec 2007
Posts: 188
poornima is on a distinguished road
Smile Re: How to set background image for <td> using style property?

hi,
The coding given by you doesn't work.Have you checked this coding?It display warnings in errorlist.

Last edited by poornima : 01-25-2008 at 01:48 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 01-25-2008, 01:45 AM
Sathish Kumar Sathish Kumar is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 303
Sathish Kumar is on a distinguished road
Thumbs up Re: How to set background image for <td> using style property?

Hi,
Sorry for the wrong code.Try this.
<td background="images/bg_space_panel.gif">&nbsp;</td>
__________________
Sathish Kumar.R
Knowledge is meant to SHARE
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 01-31-2008, 12:24 AM
poornima poornima is offline
D-Web Sr.Programmer
 
Join Date: Dec 2007
Posts: 188
poornima is on a distinguished road
Smile Re: How to set background image for <td> using style property?

Hi Sathish,
Thanks.Your code is working.But it is not showing the full image.To get full image we have to give as much space that it require to show the whole image.But background is not a valid property of <td>.If we use this,it shows warning in the errorlist.To avoid the warning,use
<td style="background-image:url(images/spacer.gif)"></td>.

Last edited by poornima : 01-31-2008 at 12:26 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 03-24-2009, 07:13 AM
leveup2 leveup2 is offline
D-Web Trainee
 
Join Date: Mar 2009
Posts: 8
leveup2 is on a distinguished road
Default Re: How to set background image for <td> using style property?

Thanks for all your post
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Background image dimension for Dreamweaver CS3 neluni HTML, CSS and Javascript Coding Techniques 8 06-20-2009 11:21 AM
How to create an image from panel background Image S.Vinothkumar C# Programming 1 10-22-2007 03:52 AM
Purpose of regexp_label property and regexp_MSW_class property? Shanthi Testing Tools 1 08-10-2007 06:01 AM
Can we capture the desktop background image programatically using c#? mobilegeek C# Programming 1 07-20-2007 01:10 AM


All times are GMT -7. The time now is 09:55 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0