1

My goal is to center this datatable that doesn't fill the width of the screen.

I have tried applying center-align styling to the row, col, placing the table in a div, and styling the table itself. Nothing seems to work. What am I doing wrong?

FWIW, I removed the styling to the row and col as they had no impact...

dbc.Row([
    dbc.Col([
        html.Div([
            dash_table.DataTable(
                id='suggested_kws_tbl',
                row_deletable=True,
                export_headers='display',
                page_size=200,
                fill_width=False,
                style_cell={
                    'padding-right': '30px',
                    'padding-left': '30px',
                    'text-align': 'center',
                    'marginLeft': 'auto',
                    'marginRight': 'auto'
                }
            ),
        ],style={
            'textAlign': 'center',
            "margin-left":"20px",
            "margin-right":"20px"
        }
        ),
    ]),
]),
ah2Bwise
  • 82
  • 2
  • 17

0 Answers0