I am wondering if there is a way that you can have a dash table scroll vertically up and down automatically when the scroll bar is available.
This is a simple example (I used the same dataframe 7 times to make it long enough).
import dash
import dash_table
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/solar.csv')
long_data = pd.concat([df,df,df,df,df,df,df])
app = dash.Dash(__name__)
app.layout = dash_table.DataTable(
id='table',
columns=[{"name": i, "id": i} for i in long_data.columns],
data=long_data.to_dict('records'),
)
if __name__ == '__main__':
app.run_server(debug=False)
Is there a way to make what's on this page go vertically up and down?
I'm not sure if this is what you're looking for, but you can make the table scrollable via style_table
(reference):
app.layout = dash_table.DataTable(
id='table',
columns=[{"name": i, "id": i} for i in long_data.columns],
data=long_data.to_dict('records'),
style_table={
'overflowY': 'scroll'
}
)
If you're looking to have the table scroll automatically at a given speed, I doubt dash/plotly has in-built functionality to do that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With