In the following test case, the alt text is horizontally centered, but it’s stuck to the top of the box. How do I get it in the middle?
<html>
<body>
<div style="height: 300px; width: 300px; border: solid black 1px;">
<img src="asdfasdf" alt="foo" style="display: block; text-align: center; vertical-align: middle"/>
</div>
</body>
</html>
One advantage of tables is they provide cross-browser vertical centering. DIVs don’t. This is once case where I’d bite the bullet and add those ugly TRs and TDs.
It’s called a single-celled centering table and ugly as it is, it works.