JamesThePanda Posted August 14, 2008 Share Posted August 14, 2008 Ok I have this table that contain all the elements in my page. What I want is the table to appear center, at the moment It is aligned left. i looks ok on my screen but the person Im building it for say that I appears to be aligned left they have a different monitor size. What can I do ? Thanks James Link to comment https://forums.phpfreaks.com/topic/119602-aligning-a-table-center-with-css/ Share on other sites More sharing options...
Jahren Posted August 14, 2008 Share Posted August 14, 2008 you mean you want the table to be shown in the middle of the page? Link to comment https://forums.phpfreaks.com/topic/119602-aligning-a-table-center-with-css/#findComment-616196 Share on other sites More sharing options...
haku Posted August 14, 2008 Share Posted August 14, 2008 Without seeing your code it's hard to give you specific advice. But if you apply the following CSS to the table, it *should* center it. But as something else in your code may prevent that, it's impossible to say for sure: margin: 0 auto; Link to comment https://forums.phpfreaks.com/topic/119602-aligning-a-table-center-with-css/#findComment-616242 Share on other sites More sharing options...
TheFilmGod Posted August 14, 2008 Share Posted August 14, 2008 It will only center using margin: 0 auto; if the table has a specified width. If the width of the table is 100% then you must make the content in the table center itself. Link to comment https://forums.phpfreaks.com/topic/119602-aligning-a-table-center-with-css/#findComment-616326 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.