@jinnyzor my example works here with dash_design_kit components. The sample data here generates 30 rows, but is cut off at 21. I would like the other rows to overflow onto another page. The section page only acts as a bookend for the report and I don’t think is the issue.
import dash
from dash import html
import dash_design_kit as ddk
import pandas as pd
app = dash.Dash()
# this functtion is here because it is only used for thtis example, but you wouldn't need it to distribute the table rows in your own apps
def section_page(title, bg_color="var(--accent)"):
"""
A helper function to generate a full color page with a title
@param title: The title
@param bg_color: The color for the page. By default, the accent color from ddk.
"""
section = ddk.Page(
[
html.Div(
title,
style={
"marginTop": "2in",
"fontSize": "40px",
"fontWeight": "bold",
"text-align": "center",
},
),
],
style={"backgroundColor": bg_color, "color": "#fff"},
)
return section
table_page = ddk.Page(
html.Div(
children=
[
ddk.DataTable(
columns=[
{"name": ["", "Year"], "id": "year"},
{"name": ["City", "Montreal"], "id": "montreal"},
{"name": ["City", "Toronto"], "id": "toronto"},
{"name": ["City", "Ottawa"], "id": "ottawa"},
{"name": ["City", "Vancouver"], "id": "vancouver"},
{"name": ["Climate", "Temperature"], "id": "temp"},
{"name": ["Climate", "Humidity"], "id": "humidity"},
],
data=[
{
"year": i,
"montreal": i * 10,
"toronto": i * 100,
"ottawa": i * -1,
"vancouver": i * -10,
"temp": i * -100,
"humidity": i * 5,
}
for i in range(30)
],
style_header={
'text-align': 'center',
},
merge_duplicate_headers=True,
)
]
)
)
# Create the final layout
app.layout = ddk.App(
ddk.Report(
orientation='horizontal',
children=[
section_page("Title of the report"), # all the pages that you want to put before the table pages
table_page,
section_page("End of the report") # all the pages that you want to put after the table pages
]
)
)
if __name__ == "__main__":
app.run_server(debug=True)