My DataGrid has 6 columns and I want the last column to align right, I write
NumberCell numberCell = new NumberCell();
Column<ServiceLogLevel, Number> debugLogLevelCol = new Column<ServiceLogLevel, Number>(numberCell){
@Override
public Integer getValue(ServiceLogLevel serviceLogLevel) {
// TODO Auto-generated method stub
return serviceLogLevel.getDebugLogLevel();
}
};
debugLogLevelCol.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
resultGrid.addColumn(debugLogLevelCol, "debug log level");
but I found the data cannot be shown (columnAlignRight.jpg), but if change to use Align_center or align_left, the data can be shown correctly (as shown in columnAlignCenter.jpg).
Using IE8 debug mode, I see that the
<div> is wider than the <td>,
and I think if using align right, the data is shown outside the <td> and so cannot be seen.
why will this happen?
Also, I am using gwt 2.4, I check the api and datagrid has no method
setWidth(java.lang.String width,
boolean isFixedLayout)
as in CellTable?