Webforumz's RSS FeedRSS Webforumz RegistrationRegister Contact Webforumz StaffContact

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.


 Subscribe in a reader

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

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Oct 2nd, 2006, 09:56
Junior Member
Join Date: Mar 2006
Age: 43
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old Oct 2nd, 2006, 12:19
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 2nd, 2006, 17:33
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Quick Firefox CSS question

I am curious as to why you feel the need to be specifying; display: block; in your table styling.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Oct 2nd, 2006, 17:51
Junior Member
Join Date: Mar 2006
Age: 43
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Oct 2nd, 2006, 18:07
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Re: Quick Firefox CSS question

margin:0 auto?
__________________

Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Oct 2nd, 2006, 18:54
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Oct 2nd, 2006, 19:18
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Re: Quick Firefox CSS question

vertically centered is trickier but doable.

Example Here of Vert/Horiz centering with CSS
__________________

Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Oct 2nd, 2006, 23:10
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
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;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Oct 2nd, 2006, 23: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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Oct 2nd, 2006, 23:46
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Quick Firefox CSS question

It'd really be helpful to see this in action.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Oct 3rd, 2006, 08:59
Junior Member
Join Date: Mar 2006
Age: 43
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
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 10:51
quick question jtyoungs PHP Forum 7 Sep 25th, 2007 16:45
QUICK, need help with code for firefox users crowmisfits Starting Out 2 Sep 2nd, 2007 13:20
Quick question extrememonkey Website Planning 0 Mar 27th, 2007 18:56
Quick question Accurax Web Page Design 5 Nov 1st, 2006 18:44


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


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8