How can I increase the overall width of my data_editor table?

Welcome to the community and thanks for your question! :blush: To increase the overall width of your st.data_editor, set your app to wide mode using st.set_page_config(layout=“wide”) at the very top of your script. This allows Streamlit elements, including st.data_editor, to use the full browser width. Additionally, use width=“stretch” (the default) or specify a pixel value for the width parameter in st.data_editor to control the table’s width. The “content” option will not exceed the parent container’s width, so “wide” mode is essential for maximum space.

Here’s a minimal example:

import streamlit as st
import pandas as pd

st.set_page_config(layout="wide")  # Must be the first Streamlit call

df = pd.DataFrame({"A": range(10), "B": range(10)})
st.data_editor(df, width="stretch")  # or width=1500 for a fixed pixel width

If you want to further tweak the sidebar width, recent Streamlit versions allow you to set the sidebar width in st.set_page_config via the initial_sidebar_state parameter (e.g., initial_sidebar_state=400 for 400px). For more details, see the Streamlit API docs and community discussions.

Sources: