RE: Centring a table on a page with CSS
by Wigmore Pippa <pippa.wigmore(at)knowledgepool.com>
|
| Date: |
Tue, 12 Mar 2002 13:37:16 -0000 |
| To: |
"'r.bhaskar(at)compserv.gla.ac.uk'" <r.bhaskar(at)compserv.gla.ac.uk>, hwg-basics(at)hwg.org |
| |
todo: View
Thread,
Original
|
|
If you don't put any widths in your table or the cells, the table will take
up as much space as it needs.
As regards the centring of the table,<.div align="center"> should work.
Make sure that you do not have anything after your table which is pushing it
off to one side.
The style command will not align it as 'align' is not a style property.
Pippa
-----Original Message-----
From: Raj Bhaskar [mailto:raj(at)lordofthemoon.com]
Sent: 12 March 2002 12:46
To: hwg-basics(at)hwg.org
Subject: Centring a table on a page with CSS
Hi folks,
I've got a table on a page that I'm trying to centre as follows:
<.div align="center" id="main">
<.table>
... usual table stuff here ...
<./table>
<./div>
but it won't do it, the table remains centred to the left. I'm guessing
that something in my stylesheet is causing problems so I've enclosed
the appropriate class here:
#main {background-color: #ffffff;
border: 10px solid white;
width: 650px;
align: center;}
Also, I don't want to put in an explicit width here, but if I don't then the
table will stretch to the full width of the page. Is there any way around
this (to have the table/div be only the width of the largest element).
TIA,
Raj.
--
Rajnish Bhaskar
r.bhaskar(at)compserv.gla.ac.uk, http://lordofthemoon.com
IT Education Unit, University of Glasgow
http://www.iteu.gla.ac.uk/
--
Only buffoons refer to the Internet as the Information Superhighway.
-- (The Rough Guide to the Internet 1999)
HTML: hwg-basics mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.