Hi
I am attempting to center my table horizontally and it isn’t working out for me.
I have tried using the follow css which works when I center my headings, but not on tables.
'text-align': 'center'
What am I doing wrong?
import pandas as pd
from dash import Dash, dash_table, html
import pandas as pd
df = pd.read_csv('my.csv')
app = Dash(__name__)
app.layout = html.Div([
html.H1(children="Heading 1", style=hdg_styles),
html.H2(children="Heading 2", style=hdg_styles),
html.P(children="paragraph", style=par_styles),
dash_table.DataTable(
data = df.to_dict('records'),
columns=[{'id': c, 'name': c} for c in df.columns],
style_cell={'textAlign': 'left'},
style_table=tbl_styles)
])
if __name__ == '__main__':
app.run_server(debug=True)