Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Dash table padding

The background of the page is a light gray while the table has a white background, but however I change the styling of the table, it appears shrink wrapped. I tried adjusting the padding, but the changes aren’t displaying. What am I missing?

 40 def generate_table(dataframe, max_rows=10):
 41         return html.Table(
 42                 # Header
 43                 [html.Tr([html.Th(col) for col in dataframe.columns])] +
 44 
 45                 # Body
 46                 [html.Tr([
 47                     html.Td(dataframe.iloc[i][col]) for col in dataframe.columns
 48                 ]) for i in range(min(len(dataframe), max_rows))], style={
 49                     'margin-left': 'auto',
 50                     'margin-right': 'auto',
 51                     'padding-left': '200px',
 52                     'background-color': '#ffffff'
 53                  }
 54         )
1 Like