here's how you do it in UiBinder <g:HorizontalPanel width="100%"> <g:Cell horizontalAlignment="ALIGN_CENTER"> <g:VerticalPanel/> </g:Cell> </g:HorizontalPanel>
the above code will center your vertical panel On Mar 18, 3:02 pm, Philippe <pjean.ge...@gmail.com> wrote: > Great, it works !!! Thank you for the tip. > > Chris Lercher a �crit : > > > > > I also had the same problem, and the only way I found was to do this > > programmatically, with > > > @UiField(provided=true) > > VerticalPanel verticalPanel; > > > And instantiating the vertical Panel + setting the horizontal > > alignment before calling uiBinder.createAndBindUi(this) > > > On Mar 18, 9:27 am, Gecko <pjean.ge...@gmail.com> wrote: > > >> I'm trying to center a vertical panel on the browser but it does not > >> work. I'm newbie... help me please !!! > > >> I'm using UiBinder as shown below : > > >> <g:HorizontalPanel horizontalAlignment="ALIGN_CENTER" width="100%" > > >> <g:VerticalPanel> > >> ... > >> </g:VerticalPanel> > >> </g:HorizontalPanel> > > >> From the ui.xml, the java code below is gennerated : > > >> com.google.gwt.user.client.ui.VerticalPanel f_VerticalPanel2 = > >> (com.google.gwt.user.client.ui.VerticalPanel) > >> GWT.create(com.google.gwt.user.client.ui.VerticalPanel.class); > >> com.google.gwt.user.client.ui.HorizontalPanel f_HorizontalPanel1 = > >> (com.google.gwt.user.client.ui.HorizontalPanel) > >> GWT.create(com.google.gwt.user.client.ui.HorizontalPanel.class); > > >> f_VerticalPanel2.add(okbandeau); > >> f_HorizontalPanel1.add(f_VerticalPanel2); > >> f_HorizontalPanel1.setHorizontalAlignment(com.google.gwt.user.client.ui.Has > >> HorizontalAlignment.ALIGN_CENTER); > >> f_HorizontalPanel1.setWidth("100%"); > > >> And finally, I obtain the html code below : > > >> <table cellspacing="0" cellpadding="0" style="height: 100%; width: > >> 100%; position: absolute; left: 0px; top: 0px; right: 0px; bottom: > >> 0px;"> > >> <tbody> > >> <tr> > >> <td align="left" style="vertical-align: top;"> > >> <table cellspacing="0" cellpadding="0"> > >> <tbody> > >> <tr> > >> <td align="left" style="vertical-align: top;"> > >> <table cellspacing="0" cellpadding="0"> > >> <tbody> > >> <tr> > >> <td align="left" style="vertical-align: top;"> > >> ... > >> </td> > >> </tr> > >> </tbody> > >> </table> > >> </td> > >> </tr> > >> </tbody> > >> </table> > >> </td> > >> </tr> > >> </tbody> > >> </table> > > >> I think I made a mistake somewhere because I get in the first "td" <td > >> align="left" style="vertical-align: top;"> when I should <td > >> align="center" style="vertical-align: top;"> > > >> Thank you for any help. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.