MDanz Posted November 6, 2009 Share Posted November 6, 2009 i have a variable which is an image $image = "<img src='$imagelocation' width='50px' height='50px'>"; i want it to be in the center of the td but it doesn't center vertically, it stays at the top, i did this echo "<td valign='middle'><div class='rollover' align='center'> <a href=\"imageview.php?id=$number\" onmouseover=\"ChgText($keyword)\">$image</a> </div> </td>"; any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/180493-valignmiddle-not-working/ Share on other sites More sharing options...
BillyBoB Posted November 6, 2009 Share Posted November 6, 2009 Why do you have a div within a table? Tables are for tabular data not templates, consider making your sites with divs instead. Also the valign attribute is deprecated, if you insist on trying to use vertical align use the css style. style=\"vertical-align: middle;\" Quote Link to comment https://forums.phpfreaks.com/topic/180493-valignmiddle-not-working/#findComment-952273 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.