|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
It's a simple problem, how do I center a table with CSS ?
Thank you. ![]()
__________________
Pupeno: pupeno@pupeno.com http://www.pupeno.com Science Fiction Readers: http://sfreaders.com.ar |
|
#2
|
|||
|
|||
|
IIRC... you can wrap it in a div or span with a class that has align: center;
Don't have access to my stylesheet here at work, but I know I went through the same problem a week ago when I transfered my normal HTML to XHTML (well, almost ) |
|
#3
|
|||
|
|||
|
I tryed with align and text-align to center; in the table or a surrounding div and didn't work, if anybody is sure about this, please, tell me, maybe I did something wrong.
If someone has to do it, I would like to do it in the table (without the surronding div), but anything that works will work (if it's XHTML 1.1/CSS). Thank you. ![]() |
|
#4
|
|||
|
|||
|
Code:
table { margin-right: auto; margin-left: auto }
However, I have had some difficulty in getting it to work in IE5 and NN4.5. What does seem to work is to use the same CSS properties and values with DIV. Such as... PS... I got this to work in IE6 with the html loose, transitional, and strict doctype, but without a doctype declaration, it would not center the table in IE6. Last edited by etm117 : July 15th, 2002 at 03:08 PM. |
|
#5
|
|||
|
|||
|
Since tables aren't necessarily text, they tend not to obey the text-align member of defined classes in some browsers. I find the only sure fire solution is to stick to good old html <center></center> tags and not worry about css for that one.
|
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > simple problem with tables and CSS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|