user346034
user346034

Reputation:

Remove gap between rows in GWT Grid

I've got a GWT Grid filled with Image widgets:

private Grid puzzleTable = new Grid(4, 2);
[...]
for ( y = 0; y < 3; ++y ) {
  for ( x=0; x < 2; ++x ) {
    Image img = new Image( DEFAULT_IMAGE_DIR+"/portrait"+"_"+y+"_"+x+".png" );
    puzzleTable.setWidget( y, x, img );
  }
}

Then I want to remove all the spacing/padding of the table cells:

puzzleTable.setCellPadding(0);
puzzleTable.setCellSpacing(0);

However, there remains a gap between the rows. The gap seems to be some spacing for the bottom of the cell. I already tried to apply different CSS settings to the table, rows and cells but nothing helped. Any ideas?

Upvotes: 0

Views: 1987

Answers (1)

thirtydot
thirtydot

Reputation: 228182

Assuming that new Image(..) creates an img element in the HTML:

Add this CSS:

td img {
    display: block
}

For an explanation, see: https://developer.mozilla.org/en/Images%2c_Tables%2c_and_Mysterious_Gaps

Upvotes: 3

Related Questions