471,337 Members | 985 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Re: Centering a Table

replace Q with c Mike Copeland wrote:
I have a simple (?) page that has only a table as its content (I
suppose I could do it some other way, but I'm unsure of how...). I want
the table to be centered on the page. It works with I.E., but fails
with other browsers (FF, SeaMonkey, etc.): it aligns on the left part of
the page.
Apart from of the annoying differences with I.E. and other browsers,
what can I do to assure the table's data is centered on the rendered
page? TIA
http://mrcccs.890m.com/RHContact.html
Tables are block elements, you center blocks of smaller width within
other blocks by setting the left and right margins to "auto". You do not
use "text-align: center" that is for alignment of inline text....

table { margin-left: auto; margin-right: auto; }

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jun 27 '08 #1
1 1355
replace Q with c Mike Copeland wrote:
I have a simple (?) page that has only a table as its content (I
suppose I could do it some other way, but I'm unsure of how...). I want
the table to be centered on the page. It works with I.E., but fails
with other browsers (FF, SeaMonkey, etc.): it aligns on the left part of
the page.
Apart from of the annoying differences with I.E. and other browsers,
what can I do to assure the table's data is centered on the rendered
page? TIA
http://mrcccs.890m.com/RHContact.html

Tables are block elements, you center blocks of smaller width within
other blocks by setting the left and right margins to "auto". You do not
use "text-align: center" that is for alignment of inline text....

table { margin-left: auto; margin-right: auto; }
I tried that, but it doesn't change any of the rendering behavior:
I.E. works, but other browsers don't.
I also removed the "text-align: center", but that made I.E. fail,
too.
It seems I didn't understand your message: could you show what code
is to be changed and where to implement the changes? TIA
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by George Ziniewicz | last post: by
1 post views Thread by Kenneth | last post: by
3 posts views Thread by yawnmoth | last post: by
1 post views Thread by Arnost Sobota | last post: by
3 posts views Thread by John Pote | last post: by
5 posts views Thread by Markus Ernst | last post: by
9 posts views Thread by Neal | last post: by
7 posts views Thread by SpaceMarine | last post: by
1 post views Thread by =?Utf-8?B?ZnJhbmt5?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.