My bad, the maxwidth stuff needed to be in style_table, not style_cell.
Look at this example:
from dash import Dash, dash_table, dcc, html
from dash.dependencies import Input, Output, State
app = Dash(__name__)
app.layout = html.Div([
dash_table.DataTable(
id='editing-columns',
columns=[{
'name': 'Column {}'.format(i),
'id': 'column-{}'.format(i),
'hideable': True,
'renamable': True
} for i in range(1, 30)],
data=[
{'column-{}'.format(i): (j + (i-1)*5) for i in range(1, 30)}
for j in range(30)
],
fixed_columns={'headers': True, 'data': 3},
editable=True,
style_table={
'maxWidth':'90vw','width':'90vw','overflowX':'auto',
},
style_header={'whiteSpace': 'normal', 'fontWeight': 'bold', 'backgroundColor': 'white', 'border': '2px solid black'},
style_cell={ 'border': '1px solid grey' },
filter_action="native",
sort_action="native",
style_data={
'whiteSpace': 'normal',
'height': 'auto',
'lineHeight': '15px',
'color': 'black',
'backgroundColor': 'white'
},
page_size=10,
),
dcc.Graph(id='editing-columns-graph')
])
@app.callback(
Output('editing-columns-graph', 'figure'),
Input('editing-columns', 'data'),
Input('editing-columns', 'columns'))
def display_output(rows, columns):
return {
'data': [{
'type': 'heatmap',
'z': [[row.get(c['id'], None) for c in columns] for row in rows],
'x': [c['name'] for c in columns]
}]
}
if __name__ == '__main__':
app.run_server(debug=True)