A project I’m working on requires me to be able to center an image in an available area. While I’ve been striving to go “tableless” and design pure CSS layouts I also need to be able to get projects done in a relatively timely manner. After trying various techniques to try to get past this issue, vertical alignment of an image, I decided, to fall back to a simple, non CSS solution. It took all of about 3 minutes, doesn’t involve any CSS hacks or Javascript.
Basically I’m a firm believer of use CSS as much as possible, but if the use of a table for presentation is necessary to keep you from using a hack or Javascript to accomplish something. By all means use that table. In this case it’s for a persons portfolio site and it’s the display area where their sample is shown. A 6 page site, with one extremely simple table implemented in a way that solves a problem without resorting to a hack.
Don’t hate the table for presentation purposes, it can get you out of a jam quickly and in the end keep your client happy when you deliver their project on time and without going over the budget. In the mean time I’ll keep looking for a pure CSS solution, and who knows maybe the w3c will come up with a solution to something that’s a pretty common issue. Seriously if you want a technology to totally replace another technology, it needs to be able to do everything it can do easily and logically.
Please feel free to comment and if you have a vertical alignment solution for this please post it… As soon as I turn on commenting