NatuScape
08-22-2007, 01:58 PM
Hello!
Pardon my newbie question... but I'm trying to figure out how to center a table accross a page (ideally I'd like it to be 80% width), and in searching this forum and many links provided, I can't find anything that points me in the right direction.
I know I can make it work by adding a DIV element to center the table, but I have to go in and add the DIV to each and every page, rather than putting some magical syntax on the CSS file that will center the table for me. Is there such a thing?
Thanks so much in advance!
Me :)
This is what I have so far (I made the table 100%, otherwise it just aligns to the left):
table.siteinfo { border-width: 2px; border-color: #5D737D; border-spacing: 2px; border-collapse: collapse;
border-style: solid; width: 100%; background-color: #D7EBF9; }
td.siteinfoleft { border-width: 1px; border-color: #5D737D; border-spacing: 1px; padding: 3pt; margin: 6px;
border-style: solid; background-color: #D7EBF9; }
td.siteinforight { border-width: 1px; border-color: #5D737D; border-spacing: 1px; padding: 3pt; margin: 6px;
border-style: solid; background-color: #51B6E6; }
td.siteinfo { border-width: 1px; border-color: #5D737D; border-spacing: 1px; padding: 3pt; margin: 6px;
border-style: solid; background-color: #FFFFFF; vertical-align: top; }
td.siteinfoshade { border-width: 1px; border-color: #5D737D; border-spacing: 1px; padding: 3pt; margin: 6px;
border-style: solid; background-color: #F4F1ED; vertical-align: top; }
Pardon my newbie question... but I'm trying to figure out how to center a table accross a page (ideally I'd like it to be 80% width), and in searching this forum and many links provided, I can't find anything that points me in the right direction.
I know I can make it work by adding a DIV element to center the table, but I have to go in and add the DIV to each and every page, rather than putting some magical syntax on the CSS file that will center the table for me. Is there such a thing?
Thanks so much in advance!
Me :)
This is what I have so far (I made the table 100%, otherwise it just aligns to the left):
table.siteinfo { border-width: 2px; border-color: #5D737D; border-spacing: 2px; border-collapse: collapse;
border-style: solid; width: 100%; background-color: #D7EBF9; }
td.siteinfoleft { border-width: 1px; border-color: #5D737D; border-spacing: 1px; padding: 3pt; margin: 6px;
border-style: solid; background-color: #D7EBF9; }
td.siteinforight { border-width: 1px; border-color: #5D737D; border-spacing: 1px; padding: 3pt; margin: 6px;
border-style: solid; background-color: #51B6E6; }
td.siteinfo { border-width: 1px; border-color: #5D737D; border-spacing: 1px; padding: 3pt; margin: 6px;
border-style: solid; background-color: #FFFFFF; vertical-align: top; }
td.siteinfoshade { border-width: 1px; border-color: #5D737D; border-spacing: 1px; padding: 3pt; margin: 6px;
border-style: solid; background-color: #F4F1ED; vertical-align: top; }