MDanz Posted September 3, 2009 Share Posted September 3, 2009 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'> Quote Link to comment Share on other sites More sharing options...
ignace Posted September 3, 2009 Share Posted September 3, 2009 What do you mean by the valign=middle part shows? Your image is vertically centered? Quote Link to comment Share on other sites More sharing options...
MDanz Posted September 3, 2009 Author Share Posted September 3, 2009 i mean it shows the text VALIGN='middle.. it should show the image but its not... this is weird i dont see where i've gone wrong... if i echo $image it shows the image... Quote Link to comment Share on other sites More sharing options...
Bricktop Posted September 3, 2009 Share Posted September 3, 2009 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'> Quote Link to comment Share on other sites More sharing options...
MDanz Posted September 3, 2009 Author Share Posted September 3, 2009 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)? Quote Link to comment Share on other sites More sharing options...
Bricktop Posted September 3, 2009 Share Posted September 3, 2009 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> Quote Link to comment Share on other sites More sharing options...
ignace Posted September 3, 2009 Share Posted September 3, 2009 You mean: <td width='147px' height='110px' VALIGN='middle'>$image</td> Quote Link to comment Share on other sites More sharing options...
Bricktop Posted September 3, 2009 Share Posted September 3, 2009 You mean: <td width='147px' height='110px' VALIGN='middle'>$image</td> haha, indeed I do! Thanks Quote Link to comment 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.