You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
But if you have a function create the table dynamically and assign it to the layout, tables do not even show up. This is needed for cases where you change the page content dynamically based on other inputs, for example If you decide whether to make a table or plot some figure based on a button, or if you want to have tables inside a tab body or so you'd have to do something like this:
Hey Chris, no that's not me I did not post the question.
I just tried the example you posted here, It works! however, this line: html.Div(id='content') seemed useless to me so I tried removing it, all I could see was the button but the table didn't show up!
I tried adding this seemingly useless line to my code and it also did work, the tables now shows up fine.
So, my problem is now solved, but what is happening exactly? why does it work with this line? or why does it not work without it?!
Activity
chriddyp commentedon Dec 13, 2017
@mewais - did you post the question here? https://community.plot.ly/t/data-tables-with-multi-pages/7282/3
chriddyp commentedon Dec 13, 2017
Also, does it work if the
DataTablehas non-emptyrows?chriddyp commentedon Dec 13, 2017
Also, this example works for me:
(Taken from this thread in the community forum: https://community.plot.ly/t/dash-datatable-updating-the-number-of-rows/6448/2?u=chriddyp)
mewais commentedon Dec 14, 2017
Hey Chris, no that's not me I did not post the question.
I just tried the example you posted here, It works! however, this line:
html.Div(id='content')seemed useless to me so I tried removing it, all I could see was the button but the table didn't show up!I tried adding this seemingly useless line to my code and it also did work, the tables now shows up fine.
So, my problem is now solved, but what is happening exactly? why does it work with this line? or why does it not work without it?!
chriddyp commentedon Dec 14, 2017
Did you see the callback below?
That callback is populating the
childrenproperty of the component with the idcontent, in this casehtml.Div(id='content').For more about how callbacks work, read through the first section of the user guide: https://plot.ly/dash/getting-started-part-2
mewais commentedon Dec 14, 2017
Sorry, I meant to copy the line below it, which is truely useless as it's a hidden table with empty rows.
html.Div(DataTable(rows=[{}]), style={'display': 'none'})
chriddyp commentedon Dec 14, 2017
see the comment in the community forum here: https://community.plot.ly/t/display-tables-in-dash/4707/40?u=chriddyp (similarly #19 )
mewais commentedon Dec 14, 2017
Thanks