cancel
Showing results for 
Search instead for 
Did you mean: 

How to add in image as background image in <td>

Former Member
0 Kudos

Hi All,

we are unable get the background image.

we have used in following method.

<td align="right" class="tablemainheadergreen" height="25">

we have added class tablemainheadergreen in css file as follows:

.tablemainheadergreen

{

background-image:url(/irj/portalapps/SyncExContact/images/green/mainheader.gif);

vertical-align:middle;

}

style sheet is getting applied to all other parts except above given <td>

can you any of tell me what could be the problem and how can i resolve .

Regards

Siva

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Siva,

Nothing wrong in your code. But cross cheeck <TD></TD> & <TR></TR> tags and path of the image location.

Otherwise use the following (tested)code

.tablemainheadergreen

{

background-image: url('<b><%=componentRequest.getResource(IResource.IMAGE, "images/mainheader.gif").getResourceInformation().getURL(componentRequest)%></b>');

vertical-align:middle;

}

<td align="right" class="tablemainheadergreen" height="25">

I had tested the above code and working fine.

Please get back to me if you need any clarification.

Hope this will help you.

Cheers....

Satya

[Pls reward points if this is useful]