PDA

View Full Version : Panel toolbar with set panel height



chrisface
16 Jun 2011, 1:38 AM
Hi there,

I've been having some trouble with a panel and tablelayout. I have a colspan of 2 and two panels next to each other within it. Depending on the contents of the panel, one has a bigger height than the other and I want them to both be the same height. I decided to set a fixed height on both of them but I was getting some very strange results. Both of these panels also have toolbars on them and a combination of having toolbars and a fixed height seems to cause the layout to break. I get the result I want when not using toolbars, but unfortunately I need them.

Perhaps I'm going about this the wrong though and if you have any suggestions as to what I should do here instead I would be grateful :)

I've made a small example which you can see here, click the nice big run button after adding and removing the comments to see what I mean.

http://jsfiddle.net/zkt9Q/89/

I realise that for what I have in the example, I didn't have to use the tablelayout, but my actual table has more than just one row and other items with colspan 2 in it.

Thanks :)

skirtle
17 Jun 2011, 7:53 AM
I had a quick try but couldn't figure out what was causing your problem: I concur that toolbars seem to be causing a layout problem but it isn't obvious to me why. The toolbars have a fixed width set on them and it's much wider than the desired 50%, not sure exactly where that width is coming from. It happens in all the browsers I tried so there's clearly a non-crazy explanation for it somewhere.

I'm sure I could figure it out if I digged long enough but the thought occurs that one reason table layout might be a little ropey is that it's so rarely used. Most 'uses' of table layout are either hideous UI designs or could better be achieved using vbox and hbox layouts. Are you sure you couldn't switch to using those instead? Could you describe the overall layout you are going for?

chrisface
20 Jun 2011, 12:36 AM
Thanks a lot for verifying that it wasn't just me that it was broken for. Like you said, using a table was maybe not the best solution for what it was we were trying to do (although it was much easier). I've changed it to use hbox and vbox which is working out quite nicely now.

At least now I know to stay away from the table layout!

Thanks,

Chris.