hi,
the dt table shown 12 rows including the header, i would like to limit the display to 8 rows so that my apps will appear nicely as a single page app without the need to scroll up and down. is it possible?
hi,
the dt table shown 12 rows including the header, i would like to limit the display to 8 rows so that my apps will appear nicely as a single page app without the need to scroll up and down. is it possible?
Hi @zhsee
You can use max_rows_in_viewport
. For example,
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_table_experiments as dt
import pandas as pd
app = dash.Dash()
app.config.supress_callback_exceptions = True
DF_GAPMINDER = pd.read_csv(
'https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv'
)
DF_GAPMINDER = DF_GAPMINDER[DF_GAPMINDER['year'] == 2007]
app.layout = html.Div([
dt.DataTable(
rows=DF_GAPMINDER.to_dict('records'),
# optional - sets the order of columns
columns=sorted(DF_GAPMINDER.columns),
row_selectable=True,
filterable=False,
sortable=True,
max_rows_in_viewport=5,
id='datatable-gapminder'
)
])
if __name__ == '__main__':
app.run_server(debug=True)
it somehow able to reduce the number of display rows albeit it is not tally to the number i specified
TQVM!