Jump to content

Background Image To Tr


zohab

Recommended Posts

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.

post-40479-0-82134000-1353353780_thumb.png

Link to comment
https://forums.phpfreaks.com/topic/270918-background-image-to-tr/
Share on other sites

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.