Hey @np162629 Try this:
app.layout = dash_table.DataTable(
data=df.to_dict('records'),
sort_action='native',
columns=[{'name': i, 'id': i} for i in df.columns],
style_data_conditional=[
{
'if': {
'filter_query': '{{{col}}} < 0'.format(col=col),
'column_id': col
},
'backgroundColor': 'red',
'color': 'white'
} for col in df.columns
]
+[
{
'if': {
'filter_query': '{{{col}}} >= 0'.format(col=col),
'column_id': col
},
'backgroundColor': 'green',
'color': 'white'
} for col in df.columns
]
)