Inconsistent table width when hideing/showing a set of columns

Posted by Salman A. Kagzi on Stack Overflow See other posts from Stack Overflow or by Salman A. Kagzi
Published on 2011-06-30T07:36:34Z Indexed on 2011/06/30 8:22 UTC
Read the original article Hit count: 268

Filed under:
|
|
|

I have got a an HTML table of around 40+ columns. To make this table fit in the screen and have the data in a re presentable format we have section in this table. i.e. there are some column that are always visible and the remainder a made visible when s specific radio button (describing a section) is selected. Each radio button is associated to different number of columns.

We show/hide a column by setting/removing "display:none" style in all the cell under that column.

This all works Just fine. Now the real problem is with the width of the columns in this table. I cant use fixed with with pixel settings. I have tried using the percentage setting by giving 50% to the always visible part and rest 50% is divided between the column in a section. But I am unable to get a fixed behavior i.e. the size of the table columns across IE & FF. Some columns are just right while some are really huge.

How can I get the table to give consistent column width across browsers?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html