TabPanel N-S alignment - Problem and workaround

42 views
Skip to first unread message

ianba...@gmail.com

unread,
Aug 14, 2006, 11:35:55 AM8/14/06
to Google Web Toolkit
Seen this posted a couple of times but no resolution. Here's the
problem and a pretty duff (but useful) solution. Any better way would
be appreciated, but I've only been playing with GWT for 2 days and
never used Java before.

The problem is that the compiler ends up proiducing HTML like

<TABLE class=gwt-TabPanel cellSpacing=0 cellPadding=0><TBODY>
<TR>
<TD style="VERTICAL-ALIGN: top" align=left>

--Tab Stuff Here--

</TD></TR>
<TR>
<TD style="VERTICAL-ALIGN: top" align=left>
<DIV class=gwt-TabPanelBottom>

--Deck Stuff Here--

</DIV></TD></TR></TBODY></TABLE>

the table rows are spaced automatically hence the gap above the widget.

to fix it, add code to set the height of the top TD element to zero


private TabPanel tp = new TabPanel();
Element el = tp.getElement();
el = DOM.getChild(el,0);
el = DOM.getChild(el,0);
el = DOM.getChild(el,0);
DOM.setStyleAttribute(el,"height","0");


there has to be a better way of doing it (apart from fixing GWT, of
course)

Ian

Konstantin Scheglov

unread,
Aug 14, 2006, 12:06:10 PM8/14/06
to Google Web Toolkit

> there has to be a better way of doing it (apart from fixing GWT, of
> course)

I think that it is better to fix GWT. I am going to package in
product GWT with my fixes. At least this is more perspective than
infinite waiting for responce from GWT team.

Smeuky

unread,
Aug 15, 2006, 4:44:16 AM8/15/06
to Google Web Toolkit
Yep, VERY annoying bug.

Hopefully, your fix works for IE but unfortunately it doesn't for
firefox :(

Ian Bambury

unread,
Aug 15, 2006, 6:40:05 AM8/15/06
to Google-We...@googlegroups.com
Oops. Firefox has a different concept of zero from IE - try setting the height to 1px, that works in Firefox
Reply all
Reply to author
Forward
0 new messages