473,385 Members | 1,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Center Tables with CSS

Hi,

I have a very crazy problem with CSS. I have tried to center my tables
with
TABLE {margin-left:auto; margin-right:auto}
how it is described in many other postings.
Mozilla and Konqueror are accepting this way of centering the table
but not IE.
I also tried
TABLE {margin-left: 0 auto}
which I have seen recently, too. But nothing works.

Had anyone the same problem and can help me. If not, I have to center
the tables with the "align" attribute. But if it's possible I want to
avoid that.

Bye

Bastian
Jul 20 '05 #1
6 2641


Bastian wrote:
I have a very crazy problem with CSS. I have tried to center my tables
with
TABLE {margin-left:auto; margin-right:auto}
how it is described in many other postings.
Mozilla and Konqueror are accepting this way of centering the table
but not IE.


I think IE6/Win should do the right thing with that CSS if you make sure
your document is rendered in CSS standards-compliant mode
http://msdn.microsoft.com/library/de...hancements.asp
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
Els
Bastian wrote:
Hi,

I have a very crazy problem with CSS. I have tried to center my tables
with
TABLE {margin-left:auto; margin-right:auto}
how it is described in many other postings.
Mozilla and Konqueror are accepting this way of centering the table
but not IE.
I also tried
TABLE {margin-left: 0 auto}
which I have seen recently, too. But nothing works.

Had anyone the same problem and can help me. If not, I have to center
the tables with the "align" attribute. But if it's possible I want to
avoid that.


For IE5 (and 4) you will need the center:align; property in
the style of the parent element.
http://locusmeus.com/html-css/centeringpage.html is about
centering a page, but the same principle goes for tables,
I'd think.

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -

Jul 20 '05 #3
Bastian wrote:
I have a very crazy problem with CSS.
comp.infosystems.www.authoring.stylesheets is a couple of doors along, this
is the html authoring newsgroup.
I have tried to center my tables
with
TABLE {margin-left:auto; margin-right:auto}
how it is described in many other postings.
Mozilla and Konqueror are accepting this way of centering the table
Yup, they are good browsers.
http://dorward.me.uk/www/centre/#block
but not IE.
You are probably using an obsolete version of IE, or are failing to trigger
standards mode.

http://dorward.me.uk/www/centre/#ie explains the work arounds.
I also tried
TABLE {margin-left: 0 auto}


This means the same as:

margin-top: 0;
margin-bottom: 0;
margin-left: auto;
margin-right: auto;

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 20 '05 #4
David Dorward <do*****@yahoo.com> wrote:
I also tried
TABLE {margin-left: 0 auto}


This means the same as:

margin-top: 0;
margin-bottom: 0;
margin-left: auto;
margin-right: auto;


Margin-left only takes one value, correct usage: "margin:0 auto".

--
Spartanicus
Jul 20 '05 #5
Els
Spartanicus wrote:
David Dorward <do*****@yahoo.com> wrote:
I also tried
TABLE {margin-left: 0 auto}


This means the same as:

margin-top: 0;
margin-bottom: 0;
margin-left: auto;
margin-right: auto;


Margin-left only takes one value, correct usage: "margin:0 auto".


I just looked at this sentence of yours, and the code above,
and again, and once more.. and then I saw the difference.

Funny how you see what you're expecting to see, while it's
not really there ;-)

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -

Jul 20 '05 #6
Spartanicus wrote:
Margin-left only takes one value, correct usage: "margin:0 auto".


Whoops - misread the previous post.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Campbell's List | last post by:
Hi, I'm completely new to MySql and need help importing tables from Access or Dbase. I am using Dreamweaver MX to create a data-driven web site. With the VPS hosting plan we're on, our remote...
3
by: Bastian | last post by:
Hi, I have a problem with CSS. I read in other postings that it should be possible to center tables by TABLE {margin-left:auto; margin-right:auto} in an external stylesheet. But it doesn't...
2
by: googley | last post by:
I'm starting a new thread for a problem that I ran into.. I'm trying to use STYLE SHEETS/CSS to update multiple table widths across many pages. I did get it working with one small problem that...
9
by: klh | last post by:
We are running on Win 2003/DB2 V8 FP7a. My question concerns Task Center. I have about 200 tasks created and scheduled in Task Center. We are going to be moving many of the databases from this...
3
by: scoffer | last post by:
Hi all, I have a problem when I try to open the tables list on a database. I work with 8.2.0 Enterprise Edition. The control center return this error: SQL0104N E' stato trovato un token...
0
by: Sharath | last post by:
Quality Globe is Glad to Offer you the Fast Track course on Automation, QTP Basics and Advanced, and Quality Center Starting Date: June 4th, 2007 Timings: 10 AM to 3:30 PM Duration: 50 Hours ...
0
by: CptJack | last post by:
I've been banging my head on this one for a while now, so maybe someone else can figure out what's wrong here. I have several tables throughout my site which are defined using: <asp:Table...
14
by: gaijinco | last post by:
I was a hobbist web coder for years but I had to sidestep for a while. Now I'm trying to return to it and I'm trying to clarify how am I supposed to do somethings with CSS v.s. HTML and I'm...
13
by: Stevo | last post by:
I've found that for IE6+, if you add the property text-align:center to a DIV, then *anything* inside it gets centered. That can be a table, an object/embed, another DIV, an image, or some text. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.