The "width" parameter does not work in the st.dataframe function

Hello and respect
Friends in the following function:

st.dataframe(data=None, width=None, height=None)

“Width” doesn’t work for me, where is the problem?

Hi @amiran,

Can you share the snippet you’re trying to run? I assume it’s not the line above since width=None there?


import panas as pd
import streamlit as st
title = dict
status = title.items()
df = pd.DataFrame(status)
st.dataframe(data=df, width=2000, height=1000)

In the code snippet above, the problem is not solved by using any number range.
thanks for your help

Hi @amiran,

That code snippet doesn’t run (pandas is spelled incorrectly and .items is missing an argument), but the following does:

import pandas as pd
import streamlit as st

d = {'col1': [1, 2], 'col2': [3, 4]}
df = pd.DataFrame(data=d)
st.dataframe(data=df, width=100, height=250)

Hey @amiran, we have rolled out some fixes related to dataframe width with the last release (1.13). Does this solve your issue?

Hello friends
Thank you
Yes, it’s solved now, everything we did before the update was not working. :smiley:


This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.