Soapbox - dylan’s online rantspace

CSS Display Block issue with tables in firefox

August 11th, 2006 by Dylan Hall

A quick note, something that’s been bugging me for a week and a half at work - I have a table that is being hidden and displayed using javascript and display: block;/display: none;

In IE this was all fine and good, however whenever firefox displayed the table it lost it’s width formatting.

The trick is to set any table to ‘display: table;’ - not something i’ve used before. tables, in my understanding, should display as block elements and retain formatting like width etc, but firefox does have a few small things like this you need to be careful of.

This page on quirksmode.org details the various display modes nicely, although it doesn’t refer to this particular quirk.

Please note, IE6 does not support ‘display: table;’ so you have to make sure you do a browser detect and ensure the code for IE still uses ‘display: block;’

gotta love the incompatibility..

Just a quick note to anyone who may have e-mailed me

June 5th, 2006 by Dylan Hall

Microsoft Ipod Parody

March 23rd, 2006 by Dylan Hall

Japanese robot to look after elderly

March 16th, 2006 by Dylan Hall

A brief history of Cold Fusion

March 15th, 2006 by Dylan Hall

New Custom Wordpress Theme

March 12th, 2006 by Dylan Hall

Altec Lansing FX6021 speakers - NEW TOY!!

March 7th, 2006 by Dylan Hall

Apple, slight rant, anti-thereof

March 6th, 2006 by Dylan Hall

Firefox css - Overflow: hidden; fixes shortened surrounding div tags

March 3rd, 2006 by Dylan Hall

Quirksmode

February 27th, 2006 by Dylan Hall