Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > center table

Reply
Thread Tools

center table

 
 
earl
Guest
Posts: n/a
 
      11-11-2003
<table width="640" cellpadding="0" cellspacing="0" id="mainTable">

#mainTable
{
border : 1px;
border-color: black;
width: 640px;
margin-left: auto;
margin-right: auto;
}

The above code centers the table using opera 7.0 but not with IE 6.0. I like
to do this using css and not html. Is there something Im missing ?




 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      11-11-2003
"earl" <> wrote:

><table width="640" cellpadding="0" cellspacing="0" id="mainTable">
>
>#mainTable
>{
> border : 1px;
> border-color: black;


This would be better as
border: 1pxs solid black;
or
border-width: 1px;
border-style: solid;
border-color: black;

> width: 640px;
> margin-left: auto;
> margin-right: auto;
>}
>
>The above code centers the table using opera 7.0 but not with IE 6.0. I like
>to do this using css and not html. Is there something Im missing ?


It will work in Win IE6 if you include a doctype that triggers
standards mode rather than quirks mode. See
http://www.hut.fi/~hsivonen/doctype.html

It will not work in Win IE5.5 and lower.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <> <http://steve.pugh.net/>
 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      11-11-2003
earl wrote:
> margin-left: auto;
> margin-right: auto;


> The above code centers the table using opera 7.0 but not with IE 6.0. I
> like to do this using css and not html. Is there something Im missing ?


MSIE has more then a few bugs. Workarounds here:
<http://dorward.me.uk/www/centre/#ie>

--
David Dorward http://dorward.me.uk/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
can a table align vertical-center on the web form Rabbit ASP .Net 1 02-12-2006 03:09 AM
Naming of core NASA center with the words "Mission Control Center" & mass use of religious anthem sounding word "Mission" in Context of Space Exploration & the Moon Landing Hoax moonlandinghoaxreligious@yahoo.com Digital Photography 0 09-27-2005 08:28 PM
Align="Center" dosen't work in the Table on my asp.net page ALI-R ASP .Net 4 02-14-2005 09:15 PM
Table/table rows/table data tag question? Rio HTML 4 11-05-2004 08:11 AM
Could not load type VTFixup Table from assembly Invalid token in v-table fix-up table. David Williams ASP .Net 2 08-12-2003 07:55 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57