import plotly.graph_objects as go
fig = go.Figure(data=[go.Table(
header=dict(values=['A Scores', 'B Scores'],
line_color='darkslategray',
fill_color='lightskyblue',
align='left'),
cells=dict(values=[[i for i in range(100)], # 1st column
[i for i in range(100)]], # 2nd column
line_color='darkslategray',
fill_color='lightcyan',
align='left'))
])
fig.update_layout(width=500, height=300)
fig.show()
How can I make it so the table is centred around a custom row (say the 50th row here) when a button is pressed?
You could try a combination of anchor tags on each row of the table and then making the button change the URL to go to #row-id. This doesnβt guarantee that the row will be centred though, only that it will be in view.
Iβd suggest on the GitHub issue tracker https://github.com/plotly/dash/issues. My gut feeling is that this would best be part of DataTable, since it has attributes such as derived_viewport_row_ids which could be changed to a settable attribute or a new function added.