Hi
Wondering why the tables dont center on this site - www.caperdu.com
The heading and the body should be centered by CSS. They are both in a table of class 'Center'.
The class is:
table.center {
width: 90%;
margin-left: auto;
margin-right: auto;
margin: 0px; /*cellspacing*/
padding: 0px; /*cellpadding*/
border: 0
}
The class seems to be properly set on the tables as changing the width or padding changes the table's layout. but still the content is not centered.
This seems to be the right way to center tables with CSS according to http://www.granneman.com/webdev/coding/ ... erta/index
The page source is here: http://www9.brinkster.com/goodwin/caperdu/
and the css is here: http://www9.brinkster.com/goodwin/caperdu/layout.css
any comments greatfully received!
thx
dave
Can't Center tables
- nilson
- Posts: 4100
- Joined: February 15th, 2003, 11:55 pm
- Location: Tuscaloosa, Alabama
- Contact:
Although ulikely, it could be that the table *is* centered, and the content inside the table is not. You could try temporarily putting a border on the table to see if this is the case, and if it is, put
in the table.center class def.
Other than that, I dunno. Hope it helps.
Code: Select all
text-align: center;
in the table.center class def.
Other than that, I dunno. Hope it helps.
-
- Posts: 139
- Joined: November 5th, 2002, 11:35 am
- Location: Lyon, France
- Contact:
Re: Can't Center tables
djg wrote:Code: Select all
table.center {
width: 90%;
margin-left: auto;
margin-right: auto;
margin: 0px; /*cellspacing*/
padding: 0px; /*cellpadding*/
border: 0
}
Code: Select all
margin: 0px;
Code: Select all
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
Code: Select all
margin-left: auto;
margin-right: auto;
Unfortunatly, support for this is very bad (according E.Meyer in Eric Meyer on CSS) so you can keep the ugly cellspacing table attribute.
- nilson
- Posts: 4100
- Joined: February 15th, 2003, 11:55 pm
- Location: Tuscaloosa, Alabama
- Contact:
-
- Posts: 49
- Joined: November 25th, 2002, 9:15 am
nice site - like the clean design.wish i could show off mine (www.davidgoodwin.net) but something has gone wrong on my server (in nyc) and I'm currently in TX
dave
dave
-
- Posts: 634
- Joined: November 5th, 2002, 5:35 am
- Location: The Netherlands, when not travelling
Dreamweaver... *shudders*djg wrote:I wonder if anyone serously codes sites by hand anymore, or if everyone now uses Dreamweaver.
I get handed Dreamweaver code from designers at work. Then I manually rip out 90% of that and hand-code it back in taking less than 10% of the space, making it suddenly work in other browsers than IE as well...
The few sites where I can do the design on my own (mostly my own, plus content management systems) are entirely handcoded. There is no other way to get something truly professional.