For those who are still struggling with CellTable
(auto-height, the pager is always under the last row) and DataGrid
(fixed header, but the height should be fixed, and the pager will remain in one place, even if you have one row of data).
Remember that they extend the same class: AbstractCellTable
This way you can easily adapt your code (Note TableType is just an enumeration I created):
if (tableType == TableType.CELLTABLE) { // CellTable CustomTableWidgetCellTableResource resource = GWT.create(CustomTableWidgetCellTableResource.class); table = new CellTable<T>(10, resource); } else { // DataGrid CustomTableWidgetDataGridResource resource = GWT.create(CustomTableWidgetDataGridResource.class); table = new DataGrid<T>(10, resource); table.setHeight("470px"); // Default height }
source share