Hello, I create a dbc.Table
and put it in a dbc.CardBody
. I just migrate to Dash
1.20.0
into 2.18.1
and dash_bootstrap_components
version 1.16.0
to 1.6.0
and have some troubles.
Codes
# Create my table
table_header = [html.Thead(html.Tr([html.Th("Station inactive"), html.Th("Dernière anomalie")]))]
table_row = []
for i in range(0, len(data)):
station_id = data.iloc[i]["station_id"]
station_label = data.iloc[i]["station_label"]
last_date_anomaly = data.iloc[i]["Dernière anomalie"]
table_row.append(
html.Tr(
[
html.Td(
dcc.Link(station_label, href="/station/" + str(station_id), target="_blank", refresh=True),
),
html.Td(last_date_anomaly),
]
)
)
table = dbc.Table(
table_header + table_row,
striped=True,
bordered=True,
hover=True,
# dark=True,
size="sm",
color="info",
)
# Create # Board station
tab_board = dbc.Card(
dbc.CardBody(
[
dbc.Row(
[
dbc.Col(
html.Div(
[
# bla bla
]
),
width=2,
),
dbc.Col(
html.Div(
[
table_station_inactive,
]
)
),
dbc.Col(
html.Div(
[
# bla bla
]
),
width=2,
),
]
),
]
),
className="mt-3",
)
Result
What I want :
What I got :
I miss something but don’t know what…