I am looking without much luck how to center an element (a table) vertically. I tried CSS vertical-align: middle; which did not work I also tried margin-top: auto; margin-bottom: auto; which also did not work. I also used the table attribute valign as "middle" which still did not work. I am using Chrome but have tested all these strategies in IE as well with the same results.
Asked
Active
Viewed 119 times
0
-
Searching SO on the tags [html] and [center] brings up a whole bunch of related questions - have you checked them? [Search link](http://stackoverflow.com/questions/tagged/html+center) – slugster Jul 24 '10 at 03:33
-
I'm sorry. I think I'll be able to find what I need on here somewhere. Thanks. – Alan Jul 24 '10 at 03:34
-
Same question was asked a hour before: http://stackoverflow.com/questions/3323463/how-to-center-a-block-level-element-vertically – BalusC Jul 24 '10 at 03:35
1 Answers
1
Here is a page which shows a technique to accomplish this and a how to use it in a couple different scenarios. This method has one issue since it relies on you knowing the height of the element you want to vertically center. If you don't know that then this will not work for you.

Matthew Manela
- 16,572
- 3
- 64
- 66