import dash
from dash_table import DataTable
app = dash.Dash(__name__)
app.layout = DataTable(
id='table',
columns=[{
'name': x,
'id': x,
'selectable': True
} for x in ['a', 'b', 'c']],
data=[{
'a': str(x) if x % 2 == 0 else '',
'b': x if x % 3 == 1 else '',
'c': str(x*x) if x % 4 == 2 else ''
} for x in range(0,100)],
style_data_conditional=[{
'if': {
'column_id': x,
'filter_query': '{{{}}} eq ""'.format(x)
},
'backgroundColor': 'pink'
} for x in ['a', 'b', 'c']]
)
if __name__ == '__main__':
app.run_server(debug=True)