The Kelly Company and Shamrock Logo
DAWKCo(tm) Software: e-Mail POP3 Server, SMTP Anti-Spam eMail Blocker, WebMail, Web Site Mapper, Website Design
Software Websites News Favorites Contact

Advanced Search


Message Board Posting: Software Topic

The content of these postings are the words of the persons posting the messages and do not necessarily reflect the views or opinions of the owners or operators of this web site.

[Software Topic Messages] [Message Board Terms Of Use]

Subject: Re: Centering tables in Netscape browsers
Posted by: Anonymous
Date: Fri, 12 Sep 2008 12:45:34 -0700
In Reply To: Re: Centering tables in Netscape browsers posted by DaveKelly on Wed, 10 Sep 2008 12:40:30 -0700

I also see some discussions about <!DOCTYPE ...> switching to accomodate the quirks of different browser versions.  It seems this could only be done dynamically on the server side and would be a huge bother just to accomodate nonconformant browsers.

I say throw the old non-standard browsers overboard and go with standards based software.

:-----Original Message-----
:I feel your pain :=|  Luckily some people have figured this one out and there's a fairly simple work-around.
:I found the following solution from Nicholas G. Theodorakis at:
:Although I take exception to his assertion that this is the correct way to center tables (implying that enclosing within a block having the { text-align: center } style is incorrect) this method does work in virtually all browsers and is simple to implement.
:Basically, create the following styles:
:text-align: center;
:margin-left: auto;
:margin-right: auto;
:text-align: left;
:Then use the following construct in your HTML:
:<div class=divctr>
:<table class=tblctr>
:<!-- your table content here -->
:To make a long story short, some browsers need the { text-align: center } style applied to the enclosing div tag and some browsers will use the { margin-left: auto } and { margin-right: auto } styles applied to the table tag (with or without the enclosing div tag).
:FYI, the { text-align: left } style applied to the table tag is a work-around for some browsers which inherit the { text-align: center } style applied to the enclosing div tag and consequently center the contents of the table cells.
:For more details about the behavior of various browsers when using different layout methods, see Theodorakis' web site.
::-----Original Message-----
::This is driving me crazy!  It seems impossible to center a table in Netscape browsers using CSS style sheets.  The deprecated <Center> HTML tag works, but without that and no matter what text-align style you enclose a table in, the table just aligns all the way to the left side.
::Anyone have a solution?

Post A Follow-up To This Message


[Software Topic Messages] [Message Board Terms Of Use]

Shamrock LogoHome | Software | Websites | News | Links | Contact | Sitemap | ^
Web Pages by DAWKCoTM Software
Copyright ©1996-2015 The Kelly CompanySM. All rights reserved.

Page Last Updated:  Thursday, 09-Mar-2017 19:40:03 EST