Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save davidcomfort/4a066fc14d76e703b27b49345601ade7 to your computer and use it in GitHub Desktop.
Save davidcomfort/4a066fc14d76e703b27b49345601ade7 to your computer and use it in GitHub Desktop.
dash_table.DataTable(
data=df.to_dict('rows'),
columns=[
{'name': i, 'id': i} for i in df.columns
],
style_data_conditional=[
{
'if': {
'column_id': 'Region',
'filter': 'Region eq "Montreal"'
},
'backgroundColor': '#3D9970',
'color': 'white',
},
{
'if': {
'column_id': 'Humidity',
'filter': 'Humidity eq num(20)'
},
'backgroundColor': '#3D9970',
'color': 'white',
},
{
'if': {
'column_id': 'Temperature',
'filter': 'Temperature > num(3.9)'
},
'backgroundColor': '#3D9970',
'color': 'white',
},
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment