Setting dataframe width doesn't have effect
See original GitHub issueSummary
Providing st.dataframe
a width doesn’t seem to have the desired effect.
Steps to reproduce
Code snippet:
st.dataframe(df, width=1200)
That’s the output of the table, regardless of whether I give the width
argument or not.
Expected behavior:
The table width is set to the integer number of pixels and the column widths are dispersed evenly within that width.
Actual behavior:
The table doesn’t change size.
Is this a regression?
Don’t think so.
Debug info
- Streamlit version: 1.10
- Python version: 3.9.13
- OS version: OS X
- Browser version: Chrome latest
Additional information
I believe this is due to the columns themselves not having width and just taking enough width to fit the values. But the header values (column names) seem to get ignored when making that calculation.
I tried to play around with the CSS but due to Canvas was unable to do things easily in inspection mode in the browser.
As an aside, would really like a full-width, responsive dataframe option (potentially as default).
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:7
Top GitHub Comments
+1 for this, the current implementation is unusable, I have to use
st._legacy_dataframe
for all dataframes instead.Has there been any updates on this? This makes Dataframes unusable right?