Mibi
Mibi

Reputation: 298

Creating proper columns in python dash

I am trying to create a dashboard with python dash and want two or more columns. Unfortunately I always end up with all the content stacked row wise. What am I missing here?

from dash import Dash, dcc, html, Input, Output
import dash_bootstrap_components as dbc


app = Dash(__name__)

app.layout = dbc.Container([
    dbc.Row([
        dbc.Col([
            html.H4('Zeitraum'),
        ], width=6),
        dbc.Col([
            html.H4('Test'),
        ], width=6)
    ]),
    dbc.Row([
        dbc.Col([
            html.H4('Test2')
        ], width=6),
        dbc.Col([
            html.H4('Test3')
        ], width=6)
    ]),
])

app.run_server(debug=True)

enter image description here

Upvotes: 0

Views: 497

Answers (1)

Waleed Malik
Waleed Malik

Reputation: 366

You just have to add an external stylesheet attribute inside your app object, like this:

app = Dash(__name__,external_stylesheets=[dbc.themes.BOOTSTRAP])

Upvotes: 1

Related Questions