Quick Firefox CSS question

This is a discussion on "Quick Firefox CSS question" within the Web Page Design section. This forum, and the thread "Quick Firefox CSS question are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 2nd, 2006, 08:56
Junior Member
Join Date: Mar 2006
Age: 42
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Quick Firefox CSS question

I want to centre a table within a div, which works okay in IE with

table {
display: block;
margin: auto;
}

But in Firefox it aligns on the left. Any ideas?
Reply With Quote

  #2 (permalink)  
Old Oct 2nd, 2006, 11:19
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Quick Firefox CSS question

You sure it's not the other way around? IE doesn't handle margin: 0 auto; very well and Firefox does. Unless I'm missing some very important information that I need to know!
Reply With Quote
  #3 (permalink)  
Old Oct 2nd, 2006, 16:33
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Quick Firefox CSS question

I am curious as to why you feel the need to be specifying; display: block; in your table styling.
Reply With Quote
  #4 (permalink)  
Old Oct 2nd, 2006, 16:51
Junior Member
Join Date: Mar 2006
Age: 42
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Quick Firefox CSS question

Yes, the problem is with Firefox and not IE.

The reason I have display: block in my table styling is because I'm still something of a novice with CSS and it was suggested as a way of centering by someone else here.

Basically, I have a table of information which I need to sit centrally within a div. is there a standard way of doing this with CSS?
Reply With Quote
  #5 (permalink)  
Old Oct 2nd, 2006, 17:07
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,738
Blog Entries: 1
Thanks: 0
Thanked 16 Times in 16 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: Quick Firefox CSS question

margin:0 auto?
__________________
The internet is just a fad.
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote
  #6 (permalink)  
Old Oct 2nd, 2006, 17:54
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Quick Firefox CSS question

Are you talking about horizontally centered, or both horizontally and vertically centered?
Reply With Quote
  #7 (permalink)  
Old Oct 2nd, 2006, 18:18
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,738
Blog Entries: 1
Thanks: 0
Thanked 16 Times in 16 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: Quick Firefox CSS question

vertically centered is trickier but doable.

Example Here of Vert/Horiz centering with CSS
__________________
The internet is just a fad.
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote
  #8 (permalink)  
Old Oct 2nd, 2006, 22:10
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Quick Firefox CSS question

Your best cross browser solution would be to style the div with;
Code: Select all
text-align: center;
As this is inherited, you will need to change the text-align back at the table level for whatever you want it to be, probably;
Code: Select all
text-align: left;
Reply With Quote
  #9 (permalink)  
Old Oct 2nd, 2006, 22:23
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Quick Firefox CSS question

If "margin: 0 auto;" doesn't center the table in Firefox, you should check your code -- you've made an error somewhere.
Reply With Quote
  #10 (permalink)  
Old Oct 2nd, 2006, 22:46
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Quick Firefox CSS question

It'd really be helpful to see this in action.
Reply With Quote
  #11 (permalink)  
Old Oct 3rd, 2006, 07:59
Junior Member
Join Date: Mar 2006
Age: 42
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Quick Firefox CSS question

Cracked it.

The display:block was unnecessary and margin: 0 auto on its own works.

Many thanks for your help.
Reply With Quote
Reply

Tags
centering, firefox, tables

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 On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Alt + S fix for Firefox (Shortcut for quick-reply) alexgeek Scripts and Online Services 0 Jan 4th, 2008 09:51
quick question jtyoungs PHP Forum 7 Sep 25th, 2007 15:45
QUICK, need help with code for firefox users crowmisfits Starting Out 2 Sep 2nd, 2007 12:20
Quick question extrememonkey Website Planning 0 Mar 27th, 2007 17:56
Quick question Accurax Web Page Design 5 Nov 1st, 2006 17:44


All times are GMT. The time now is 19:32.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

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