I have a gwt label and I place it into a gwt grid. I have some events on the label. So I need the label to fill up the entire grid cell… otherwise the mouse over events won’t trigger.
Currently I am doing a setWidth(“100%) and setHeight(“100%) on the label. This gets the label to fill horizontally… but I can’t get the height to fill the grid cell. How do you get the label to fill the entire grid cell (horz and vert)? isn’t there some sort of CSS property I can change to 100%?
The farthest I got was to wrap the label in a grid. Then embed the grid/label into the grid cell. The label then looks like it takes up the entire grid. But the events still only work for the label.
To capture the event on a cell you could use set a clickhandler on the grid and check if the passed cell in the event is the label cell you need to handle. This way you can certainly have an event that is triggered for the whole cell content.
The reason the cell is not filled 100% is very likely because the table (by default) has cell spacing set, which restricts you from getting a 100% width/height. You can set the cellspacing to 0, but this means it applies to all cells in the table, and that means you layout might change in undesired ways, so having the clickhandler on the table is a better solution.