Forum Moderators: not2easy

Message Too Old, No Replies

Scale Table to 100% of available space..

trying to make a central column stretch to max width in FF

         

drbnet

9:50 pm on May 28, 2005 (gmt 0)

10+ Year Member



Hi,

I've got a table, for simplicities sake: 3 columns by 1 row. The first and the last column need to have fixed widths, though the central column needs to take up 100% of the remaining space. The table is 100% width of the page.

This works fine in IE, but not in FF.

Any ideas?

Thanks.

Stormfx

10:24 pm on May 28, 2005 (gmt 0)

10+ Year Member



if you have the table set to 100% width, and the fixed columns' width specified, the middle column should expand to fill the empty space. It works on my FF. However, it doesn't work in Netscape. One thing you might try (only if you're specifying the widths in the html) is to set the expanding column's width to 100%. Just make sure that there's something in the other two columns to force their width.

drbnet

11:10 am on May 29, 2005 (gmt 0)

10+ Year Member



Hi,
Thanks for your response.

I thought this was the case too, and do have examples on my page where this works, however in this case it doesn't. After some testing I realised that its after hiding/showing that it fails to be 100%.

The table starts off by being hidden, then appears after a user click - this fooled me into thinking it was never 100% - but once I set it to visible to start with, it does appear as 100% - just as it should... however hide/show the table and the problem occurs.

All the show/hide script does is set the visibility and display properties (hidden/visible and none/block).

I tested what FF 'thought' the width was by alerting the value before and after it was shown/hidden - each time it stated 100%...!

Can anyone shed some light on why this might happen?

drbnet

11:18 am on May 29, 2005 (gmt 0)

10+ Year Member




I've found a work around for this which is to put the table into a div and then show/hide that - so the table keeps its sizing - Not happy with it, but hey, I'm not happy about most quirks with User Agents..!

I think the table itself was staying 100%, though the dynamic td that was initially stretched was collapsing to its minimum size when hidden/shown.

I will notch it up as a Firefox bug - unless some knowledgable person can show me a standard for this behaviour... ;o)

Thanks anyway.