Adding Grid with margin to a LayoutPanel

14 views
Skip to first unread message

hermis

unread,
Mar 21, 2012, 7:38:12 AM3/21/12
to google-we...@googlegroups.com
Hey all,

When I add a grid with 100% height to a layout panel and set a margin on it, the bottom margin is not honoured:


public void onModuleLoad() 
{
Grid grid = new Grid(1,1);
grid.setHeight("100%");
grid.getElement().getStyle().setBackgroundColor("yellow");
grid.getElement().getStyle().setMargin(10, Unit.PX);

LayoutPanel lp = new LayoutPanel();
lp.add( grid );

RootLayoutPanel.get().add( lp );

}


How can I fix this?


Thanks in advance.

Reply all
Reply to author
Forward
0 new messages