|
-
Sep 1st, 2002, 11:45 AM
#1
Thread Starter
Hyperactive Member
horizontally align (css2 & xhtml strict compliant)
Hey all,
I was wondering how i could align a table horizontally centered while still being css2 and xhtml strict compliant. I know so far the setting the right and left margins to auto will work, but it doesnt work in some browsers. Does anyone know of a more accepted way of doing it?
thanks
-
Sep 1st, 2002, 01:11 PM
#2
Frenzied Member
I think this should work:
Code:
<div style="text-align:center;">
<table width="50%" style="border:1px solid black; margin:0px auto; text-align:left;">
<tr><td>asdasd</td></tr>
</table>
</div>
The first text-align makes IE center the block elements (i.e. the table), which it shouldn't do. And the second one makes the other browsers put the inline elements in the table back to where they should be. (The width and the border are just to emphasis the effect.)
-
Sep 2nd, 2002, 09:32 AM
#3
Thread Starter
Hyperactive Member
-
Sep 2nd, 2002, 10:19 AM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|