this is the code for the pic. The filter works well just can’t be shown as normal.
supply_layout = html.Div([
html.H1(‘Data updated at: ‘+ datetime.datetime.now().strftime(’%Y-%m-%d %H:%M:%S’)),
html.Hr(),
dash_table.DataTable(
id='table1',
columns=hdlistsuply,
data=dfdatasupply.to_dict('records'),
editable=True,
sort_action='native',
filter_action="native",
row_deletable=True,
style_cell={
'whiteSpace': 'normal',
'height': 'auto',
#'border': '3px solid grey'
},
style_cell_conditional=[
{
'if': {'column_id': 'M'},
'fontWeight': 'bold'
},
{
'if': {'column_id': ' M '},
'fontWeight': 'bold'
},
{
'if': {'column_id': 'Year'},
'fontWeight': 'bold'
},
{
'if': {'column_id': 'Year'},
'textAlign': 'left'
},
{
'if': {'column_id': 'Supply'},
'textAlign': 'left'
},
{
'if': {
'row_index': 4,
},
'backgroundColor': '#DDEBF7'
},
{
'if': {
'row_index': 5,
},
'backgroundColor': '#DDEBF7'
},
{
'if': {
'row_index': 6,
},
'backgroundColor': '#DDEBF7'
},
{
'if': {
'row_index': 7,
},
'backgroundColor': '#DDEBF7'
},
{
'if': {
'row_index': 8,
},
'backgroundColor': '#DDEBF7'
},
{
'if': {
'row_index': 9,
},
'backgroundColor': '#DDEBF7'
},
{
'if': {
'row_index': 10,
},
'backgroundColor': '#DDEBF7'
},
],
style_header={
'backgroundColor': '#D9D9D9',
#'fontWeight': 'bold',
'textAlign': 'center',
#'border': '3px solid black'
#'color': 'white'
},
style_header_conditional=[
{
'if': {'column_id': 'Year'},
'textAlign': 'left'
},
{
'if': {'column_id': 'Supply'},
'textAlign': 'left'
},
{
'if': {
'header_index': 1,
'column_id': 'M'},
'backgroundColor': '#FFFF00'
},
{
'if': {
'header_index': 1,
'column_id': ' M '},
'backgroundColor': '#FFFF00'
},
{
'if': {'column_id': 'M'},
'fontWeight': 'bold'
},
{
'if': {'column_id': ' M '},
'fontWeight': 'bold'
},
],
style_data_conditional=stylessupplyup,
style_as_list_view=True,
),