Page 1 of 1

Align TABLE to center of the BODY

Posted: Mon Feb 21, 2005 1:27 am
by anjanesh
I understand that in XHTML strict for <table>, align is not available.
I had this previously :

Code: Select all

<body>
<table align="center">
...
</table>
</body>
What I want is y table to be aligned in center of the page(body) NOT the content of the table aligned to center which is what happened when I did <table style="text-align:center">
I searched google and found that the replacement for align=center is now CSS's text-align:center but the output is really not the same.
Is there anyway for my table to be aligned center of the page(body)?
Thanks

Posted: Mon Feb 21, 2005 1:31 am
by feyd
tried placing a div around the table that has the alignment setting? It's been a while since I screwed around with this stuff...

Posted: Mon Feb 21, 2005 5:41 am
by Chris Corbyn
Can't you just do

Code: Select all

<center>
<table>
....
</table>
</center>
??

Posted: Mon Feb 21, 2005 9:28 am
by timvw

Code: Select all

.center &#123;
   text-align: center;
&#125;

.left &#123;
   text-align: left;
&#125;

Code: Select all

<div class="center">
<table class="left">
</table>
</div>