CSS Display Block issue with tables in firefox
August 11th, 2006 by Dylan HallA 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..