CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 15th, 2002, 07:26 AM
Pupeno Pupeno is offline
Give peace a chance.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: Buenos Aires, Argentina
Posts: 83 Pupeno User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 39 sec
Reputation Power: 8
Send a message via ICQ to Pupeno Send a message via AIM to Pupeno Send a message via MSN to Pupeno Send a message via Yahoo to Pupeno
Question simple problem with tables and CSS

It's a simple problem, how do I center a table with CSS ?
Thank you.

Reply With Quote
  #2  
Old July 15th, 2002, 07:57 AM
etm117 etm117 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Baltimore, MD, USA
Posts: 5 etm117 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
IIRC... you can wrap it in a div or span with a class that has align: center;

Don't have access to my stylesheet here at work, but I know I went through the same problem a week ago when I transfered my normal HTML to XHTML (well, almost )

Reply With Quote
  #3  
Old July 15th, 2002, 08:07 AM
Pupeno Pupeno is offline
Give peace a chance.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: Buenos Aires, Argentina
Posts: 83 Pupeno User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 39 sec
Reputation Power: 8
Send a message via ICQ to Pupeno Send a message via AIM to Pupeno Send a message via MSN to Pupeno Send a message via Yahoo to Pupeno
Unhappy didn't work

I tryed with align and text-align to center; in the table or a surrounding div and didn't work, if anybody is sure about this, please, tell me, maybe I did something wrong.
If someone has to do it, I would like to do it in the table (without the surronding div), but anything that works will work (if it's XHTML 1.1/CSS).
Thank you.

Reply With Quote
  #4  
Old July 15th, 2002, 03:00 PM
etm117 etm117 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Baltimore, MD, USA
Posts: 5 etm117 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Code:
table { margin-right: auto; margin-left: auto }


However, I have had some difficulty in getting it to work in IE5 and NN4.5. What does seem to work is to use the same CSS properties and values with DIV. Such as...

PS... I got this to work in IE6 with the html loose, transitional, and strict doctype, but without a doctype declaration, it would not center the table in IE6.

Last edited by etm117 : July 15th, 2002 at 03:08 PM.

Reply With Quote
  #5  
Old July 15th, 2002, 03:39 PM
MJEggertson MJEggertson is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2002
Location: Seattle WA
Posts: 863 MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 sec
Reputation Power: 8
Since tables aren't necessarily text, they tend not to obey the text-align member of defined classes in some browsers. I find the only sure fire solution is to stick to good old html <center></center> tags and not worry about css for that one.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > simple problem with tables and CSS


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway