From d684265c2cf5fe8643d12c95546263caa1dd07be Mon Sep 17 00:00:00 2001 From: Dane Anderson Date: Thu, 23 Apr 2026 06:49:00 -0600 Subject: [PATCH] Fix Streamlit width=None error using use_container_width --- streamlit_app.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/streamlit_app.py b/streamlit_app.py index 472dd6170..aacffdd03 100644 --- a/streamlit_app.py +++ b/streamlit_app.py @@ -252,21 +252,21 @@ def calculate_population_difference(input_df, input_year): with col[2]: st.markdown('#### Top States') - st.dataframe(df_selected_year_sorted, - column_order=("states", "population"), - hide_index=True, - width=None, - column_config={ - "states": st.column_config.TextColumn( - "States", - ), - "population": st.column_config.ProgressColumn( - "Population", - format="%f", - min_value=0, - max_value=max(df_selected_year_sorted.population), - )} - ) + st.dataframe( + df_selected_year_sorted, + column_order=("states", "population"), + hide_index=True, + use_container_width=True, + column_config={ + "states": st.column_config.TextColumn("States"), + "population": st.column_config.ProgressColumn( + "Population", + format="%f", + min_value=0, + max_value=max(df_selected_year_sorted.population), + ), + }, +) with st.expander('About', expanded=True): st.write('''