zohab Posted November 19, 2012 Share Posted November 19, 2012 Hi, I have added background image blueGradient.png to tr. It is not showing as expected. attached image. I want to show background image properly and need help in this. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>background Image</title> </head> <body> <table width="100%" border="1"> <tr style=" background-color:#00FFFF; background-image:url(blueGradient.png); background-repeat:repeat;"> <td colspan="2" align="center">Title</td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> </body> </html> -Thanks Zohaib. Quote Link to comment https://forums.phpfreaks.com/topic/270918-background-image-to-tr/ Share on other sites More sharing options...
chwebdesigns Posted November 19, 2012 Share Posted November 19, 2012 This is just a guess at what you mean by properly! But how about: background-color: white; background-image:url(blueGradient.png); background-repeat:repeat-x; background-position: bottom left; Also just a suggestion, it is normally better to define a style in a .css file as a class (e.g. tr .background ) and then have the code <tr class="background"> Hope this helps a bit, Cal Quote Link to comment https://forums.phpfreaks.com/topic/270918-background-image-to-tr/#findComment-1393651 Share on other sites More sharing options...
play_ Posted November 21, 2012 Share Posted November 21, 2012 (edited) What does 'not showing as expected' mean? How are you expecting it to show? http://jsfiddle.net/c3txj/60/ Edited November 21, 2012 by play_ Quote Link to comment https://forums.phpfreaks.com/topic/270918-background-image-to-tr/#findComment-1394242 Share on other sites More sharing options...
Love2c0de Posted November 24, 2012 Share Posted November 24, 2012 The image is in the same directory as your html file isn't it? Or is it in a different folder called 'images' for example? Just copied your code and used my own image and it is displaying the image. It's a little hard to debug what the problem is without a specific problem. Regards, AoTB. Quote Link to comment https://forums.phpfreaks.com/topic/270918-background-image-to-tr/#findComment-1394836 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.