I've got a small table on one of my pages at http://boahc.co.uk/pracinfo/winsley and I'd like it centered so have coded <table cellpadding="0" cellspacing="0" align="center"> which works fine in IE but the table still left aligns in Firefox.

What do I need to change to get the table to center in Firefox?

Comments

Fiasco’s picture

Hi Dan,

firefox centers in a different way to IE

try adding style="margin: 0 auto" into the table tag. this applies a 0 margin at the top and bottom of the table and makes the left and right margins equal. this and the align="center" should have it centered in both IE and Firefox.

Dubber Dan’s picture

Cheers for that. I created a new class of table in my css with those margins so that I can easily use it if I need another centered table

JohnnyMoney’s picture

Thanks, that works for my table centering in firefox now.

*****************************
Drupal Video Tutorials (Spanish)
www.drupalcarmen.com

myownsummer’s picture

Thanks for the fix.