The output of dataframe

I have set output as dataframe but it does not look good. I prefer the output component to be fixed.
Anyone could give me some advice, thanks

You can set interactive=False to make the dataframe static.

thanks for your reply!

the input is an excel file and the output is a dataframe.
the method is pd.read_excel().
the purpose is the dataframe could be in a container that has a fixed width and height and users could use scroll to borrowers the whole dataframe, and I would like to set input and output as equal height which could make UI look better.
the problem is that equal_height method does not work, I think the reason is the output dataframe is dynamic.


We don’t currently support pagination / fixed rows in a gr.Dataframe but we are looking into it!

thanks for reply!

Hope you can achieve it!

I’ve opened a pull request here: Add height parameter and scrolling to `gr.Dataframe` by abidlabs · Pull Request #5283 · gradio-app/gradio · GitHub

Hi @abidlabs! I’m interested if any changes have been made recently in this regard. I have a working UI that, up until several days ago, had a Datframe which automatically set it’s height to fit the number of rows. This was my preferred setup. Without making any changes to the code, the dataframe has reverted to be a fixed height (only ~12 rows) and now a scrollbar appears. I would really like to change the dataframe back to fit the number of rows, without a scroll bar. Any thoughts on this? I initialize the dataframe like so:

 label="CosmoPlot Compilation:",type="pandas", visible=True, interactive=False)


Hi @dpraz, yes so you can set a height for the gr.Dataframe, which is kind of a max height – if you set this to a very large value, then the dataframe’s height will just be the height of the contents. Now that’s how it should behave. However, we currently have a bug that is preventing this from happening – we are looking into it! Issues · gradio-app/gradio · GitHub

1 Like

Thanks @abidlabs! Yes, I was experiencing this bug and wasn’t sure if it was an issue with the way I was coding or actually an issue with the update. Glad to see we have people on the case. Thanks again for the update.