solved it partly by this: Grid grid = new Grid(3,3); grid.setStyleName("grid"); CellFormatter cellformat=grid.getCellFormatter(); cellformat.setStyleName(0, 0, "NW"); cellformat.setStyleName(0, 1, "N"); cellformat.setStyleName(0, 2, "NE"); cellformat.setStyleName(1, 0, "W"); cellformat.setStyleName(1, 1, "C"); cellformat.setStyleName(1, 2, "E"); cellformat.setStyleName(2, 0, "SW"); cellformat.setStyleName(2, 1, "S"); cellformat.setStyleName(2, 2, "SE");
now i set the TDs directly. but i can't set the TD size smaller than 6x18??? as if there is text there which keeps the minimum size? On May 24, 11:03 am, outsource lucas <outsourcelu...@gmail.com> wrote: > I have a 3x3 Grid, and I am putting only background images in each > cell, but these images have to touch. > > Right now, I can't remove the cell spacing with CSS. I tried every CSS > style property on both the Grid (TABLE) and the cell-panels (DIVs > inside TDs). > > I inspected the generated HTML elements and because I put a > SimplePanel in each cell, each <td> contains a <div> with the > background. Is this the cause?? In normal HTML i would never do this, > and let the background be contained directly in the <td>, but I have > no clue how to do this in an elegant way in GWT (so now I am stuck > with the divs?). > > Main thing: how do I remove the spacing? > > Grid grid = new Grid(3,3); > grid.setStyleName("grid"); > > SimplePanel cell; > cell = new SimplePanel(); > cell.setStyleName("NW"); > grid.setWidget(0, 0, cell); > cell = new SimplePanel(); > cell.setStyleName("N"); > grid.setWidget(0, 1, cell); > cell = new SimplePanel(); > cell.setStyleName("NE"); > grid.setWidget(0, 2, cell); > cell = new SimplePanel(); > cell.setStyleName("W"); > grid.setWidget(1, 0, cell); > cell = new SimplePanel(); > cell.setStyleName("C"); > grid.setWidget(1, 1, cell); > cell = new SimplePanel(); > cell.setStyleName("E"); > grid.setWidget(1, 2, cell); > cell = new SimplePanel(); > cell.setStyleName("SW"); > grid.setWidget(2, 0, cell); > cell = new SimplePanel(); > cell.setStyleName("S"); > grid.setWidget(2, 1, cell); > cell = new SimplePanel(); > cell.setStyleName("SE"); > grid.setWidget(2, 2, cell); > > I have these css styles on all the <table>/Grid elements, and on all > the <div>/SimplePanel elements: > margin-top:0px; > margin-bottom:0px; > margin-left:0px; > margin-right:0px; > border-collapse:collapse; > cell-spacing:0px; > cell-padding:0px; > background-origin:border-box; > > -- > 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 > athttp://groups.google.com/group/google-web-toolkit?hl=en. -- 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.