Jump to content

valign='middle' not working!!


MDanz

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/180493-valignmiddle-not-working/
Share on other sites

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;\"

 

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.