Hi there! I’ve been experiencing some issues with DataTable formatting when using fixed header.
Specifically, the problem is that the table header is NOT aligned with the table columns when using fixed column widths. I’ve followed the same recommendations shown in the DataTable documentation page concerning fixed_rows and column widths.
I’m using the latest version of Dash (1.12). I’m pretty sure this issue is new with this update.
The reproducible code is the following:
import dash
import dash_table
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/solar.csv')
app = dash.Dash(__name__)
app.layout = dash_table.DataTable(
columns=[{"name": i, "id": i} for i in df.columns],
data=df.to_dict('records'),
fixed_rows={'headers': True},
style_cell={'minWidth': '180px', 'width': '180px', 'maxWidth': '180px'},
)
if __name__ == '__main__':
app.run_server(debug=False)
5 posts - 3 participants