PaginatedDataTable2(
renderEmptyRowsInTheEnd: false,
columns: _columns,
source: _source,
)
The empty rows are not rendered, but occupy space. How to remove the empty space?
PaginatedDataTable2(
renderEmptyRowsInTheEnd: false,
columns: _columns,
source: _source,
)
The empty rows are not rendered, but occupy space. How to remove the empty space?
I surmise that you are using the data_table_2 package.
PaginatedDataTable2 does not give a default way of doing that. You would have to filter your list to remove entirely empty rows before making it into a source. You will have to provide some more code if you need help with that.
Additional Info
According to the readme,
This makes it clear that the named parameter renderEmptyRowsInTheEnd is not there to hide empty rows within the source list as according to the data provided, rather to remove all rendered rows which make up for the total expected rows for that page (this defaults to 10 unless otherwise specified).
So as we can observe below, the total dataset has 14 members, out of which 10 (by default) are being displayed on the page:
Now, reducing the entire dataset to 6 will give us 4 additional empty rows at the end of the table as seen below: