Style not affecting table font size

Hi,
I have the following code

dbc.Col(dbc.Table.from_dataframe(table_df.tail(5),
                   striped=True, bordered=True, hover=True,id='warnings_tb',
                   style = {
                                 'font_family': 'cursive',
                                  'font_size': '54px',
                                  'text_align': 'center'
                  }
               ,
           ),
          width=5
),

The table is rendered inside the column, however style is not changing anything inside the table.
What am I doing wrong?
Thank you in advance!

Hi @jgomes_eu

Dash requires the keys in the style prop to be camelCase.

Try this:

                 style = {
                     'fontFamily': 'Arial',
                      'fontSize': '54px',
                      'textAlign': 'center'
                  }

Note - you also have to have the font family available. When I ran it, I donโ€™t have the cursive font, but others like Arial or monospace worked.

1 Like

Thank you, @AnnMarieW, that sorted it out!

2 Likes