How can I center the cards below? I have passed justify='center'
& align='center'
It does not make a diffrence and aligned to the left?
code below
def meta_card(values: dict, label: str = None, cls_name: str = None) -> list[dbc.CardHeader, dbc.CardBody]:
card_meta = [
dbc.CardHeader(label, style={"textAlign": "center"}),
dbc.CardBody(
dbc.ListGroup(
[dbc.ListGroupItem([f"{k}: {v} ", meta_pill(v, '1000')]) for k, v in values.items()],
flush=True,
)
),
]
return card_meta
dash_cards = html.Div(
dbc.Row(
[
dbc.Col(
dbc.Card(
meta_card(standing_card_meta, label="Standing", cls_name="total_standing_card"),
color="primary",
outline=True,
style={'width': '25rem'}
)
),
dbc.Col(
dbc.Card(
meta_card(volume_card_meta, label="Volume", cls_name="total_onhire_card"),
color="primary",
outline=True,
style={'width': '25rem'}
)
),
dbc.Col(
dbc.Card(
meta_card(cost_card_meta, label="Cost", cls_name="total_offhire_card"),
color="primary",
outline=True,
style={'width': '25rem'}
)
),
],
className="mb-4",
justify='center',
align='center'
)
)
Thanks for the help!
source https://stackoverflow.com/questions/74268689/plotly-dash-center-multiple-cards-within-dbc-row
Comments
Post a Comment