Jump to content

problem with table background image


MDanz

Recommended Posts

i swear i've done this correctly but its not working.

 

$imagelocation = $row_data['imagelocation'];

$image = "<img src='$imagelocation' width='144px' height='100px'>";

 

when i do this and then echo $image, it works.

 

now when i try to input it in here as background... the VALIGN= middle part shows instead of the $image.

 

<td width='147px' height='110px' background='$image' VALIGN='middle'>

 

:wtf:

 

Link to comment
Share on other sites

Hi MDanz,

 

If:

 

$image = "<img src='$imagelocation' width='144px' height='100px'>";

 

Then you're essentially saying:

 

<td width='147px' height='110px' background='<img src='$imagelocation' width='144px' height='100px'>' VALIGN='middle'>

 

Which wouldn't work.  Give the following a try:

 

<td width='147px' height='110px' background='$imagelocation' VALIGN='middle'>

Link to comment
Share on other sites

yeh that works but doesn't resize..

 

 

when i do the "<img src='$imagelocation' width='144px' height='100px'>" it actually resizes the image to that size..

 

if using $imagelocation is the only way to do this, how do i get it to resize the image to those dimensions(144,100px)?

Link to comment
Share on other sites

Hi MDanz,

 

You can't resize an image on a td background.  You could use CSS to change repeat settings and the location, or perhaps there is a Javascript function that would resize a td background image?

 

Would the below do what you need?

 

<td width='147px' height='110px' VALIGN='middle'>'$image'</td>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.