tags:

views:

159

answers:

2

let's say I have a code like this

Grid g = new Grid(2,2);
Label l = new Label("Hello");
g.setWidget(0,1, l);
s.setColspan(0,1,2); // there is no such method :(
+1  A: 

Try this:

Grid.getCellFormatter().setWidth( 0, 0, "10px"); //colspan
Grid.getCellFormatter().setHeight( 0, 0, "10px"); //rowspan
Chris Boesing
A: 

If it's an option you can use FlexTable instead of Grid:

FlexTable flexTb= new FlexTable();
flexTb.getFlexCellFormatter().setColSpan(0, 1, 2);
flexTb.setWidget(0, 1, new Label("Hello"));
DrDro
Just FYI, `FlexTable` is slower than `Grid` (http://code.google.com/p/google-web-toolkit-incubator/wiki/BulkTableRenderers), so unless you have to dynamically add cells, you should stick with `Grid` for maximum performance :)
Igor Klimer