Re: Centring a table on a page with CSS
by "Keith Sellars" <Keith(at)webgraffix.com>
|
| Date: |
Tue, 12 Mar 2002 08:16:40 -0500 |
| To: |
<hwg-basics(at)hwg.org> |
| References: |
localhost |
| |
todo: View
Thread,
Original
|
|
Try using <.center> tags instead of the <.div> tags and see if that will do
it.
Thanks,
Keith D Sellars
WebGraffix
www.webgraffix.com
"Making database sites seem easy"
----- Original Message -----
From: "Raj Bhaskar" <raj(at)lordofthemoon.com>
To: <hwg-basics(at)hwg.org>
Sent: Tuesday, March 12, 2002 7:45 AM
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)
>
>
>
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.