Darkmatter5 Posted October 20, 2008 Share Posted October 20, 2008 I have a table I want to vertically and horizontally align in a div. How can I do this? Quote Link to comment Share on other sites More sharing options...
CroNiX Posted October 20, 2008 Share Posted October 20, 2008 http://www.w3.org/Style/Examples/007/center Quote Link to comment Share on other sites More sharing options...
haku Posted October 20, 2008 Share Posted October 20, 2008 The code on the W3C site won't work in IE. As a result, it's not easy to do. Here is an article: http://www.jakpsatweb.cz/css/css-vertical-center-solution.html Quote Link to comment Share on other sites More sharing options...
msinternet Posted October 31, 2008 Share Posted October 31, 2008 you need the make sure that the container has a text-align: center; and the contents has margin-left: auto and margin-right: auto; Easy when you know how but a frustrating little IE bug. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted October 31, 2008 Share Posted October 31, 2008 display:table-cell; vertical-align:middle; text-align:center; Quote Link to comment Share on other sites More sharing options...
BoltZ Posted October 31, 2008 Share Posted October 31, 2008 I would go with the Little Guy's answer since there is alot of answers here. HTH Quote Link to comment Share on other sites More sharing options...
haku Posted November 3, 2008 Share Posted November 3, 2008 The little guy's answer won't work in IE. It doesn't recognize display:table-cell. 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.