Hi, here’s a video showing what I described, as well as the code snipped generating it.
from collections import OrderedDict
from dash import Dash, html, dcc, dash_table
import pandas as pd
app = Dash(name)
long_line = “This is a very long line, but it is completely meaningless, and nly serves the purpose of illustrating an issue found when scrolling down a datatable with lines of very different lenghts. This is a very long line, but it is completely meaningless, and nly serves the purpose of illustrating an issue found when scrolling down a datatable with lines of very different lenghts. This is a very long line, but it is completely meaningless, and nly serves the purpose of illustrating an issue found when scrolling down a datatable with lines of very different lenghts”
short_line = “This is a shorter line”
data = OrderedDict(
[
(“Lines”, [short_line, short_line, short_line, short_line, short_line, short_line, short_line, short_line, short_line, long_line]),
(“Lines2”, [short_line, short_line, short_line, short_line, short_line, short_line, short_line, short_line, short_line, long_line]),
]
)
df = pd.DataFrame(
OrderedDict([(name, col_data * 2) for (name, col_data) in data.items()])
)
app.layout = dash_table.DataTable(
data=df.to_dict(‘records’),
virtualization=True,
columns=[{‘id’: c, ‘name’: c} for c in df.columns],
fixed_rows={‘headers’: True},
style_table={‘height’: 200},
page_size=15,
)
if name == ‘main’:
app.run_server(debug=True)