Oliazk Posted April 5, 2006 Share Posted April 5, 2006 I need to center a table on a page so that its allways in the middle of the page. Not just down the center. But so that on any size it will always end up in the center of the page dead center hopefully.thanks for any suggestions Link to comment Share on other sites More sharing options...
Little Goat Posted April 5, 2006 Share Posted April 5, 2006 you know css, right? :)if so add this to the body's css:text-align:center;or if you only want that table centered and not the rest, put the table in a div and apply the css to that.LG Link to comment Share on other sites More sharing options...
zachary Posted April 6, 2006 Share Posted April 6, 2006 when you add the table do this<center>table html here</center> Link to comment Share on other sites More sharing options...
Oliazk Posted April 6, 2006 Author Share Posted April 6, 2006 ok i can center the table i have no problem with css but i want it to be centered in the middle of the page not just vertically but also horizontally Link to comment Share on other sites More sharing options...
vchris Posted April 6, 2006 Share Posted April 6, 2006 Actually the <center> element is deprecated and should not be used. I would do what Little Goat said: body {text-align: center;margin: 0 auto;} margin:0 auto; will center in all the other browser except IE so that's why you need text-align: center; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now