Method to control the width of a component like a DataFrame separately from the page layout?

:rotating_light: Before clicking “Create Topic”, please make sure your post includes the following information (otherwise, the post will be locked). :rotating_light:

  1. Are you running your app locally or is it deployed?
    Locally
  2. If your app is deployed:
    a. Is it deployed on Community Cloud or another hosting platform? NA
    b. Share the link to the public deployed app. NA
  3. Share the link to your app’s public GitHub repository (including a requirements file). NA
  4. Share the full text of the error message (not a screenshot).
    Streamlit does provide a direct method to control the width of a specific component like a DataFrame separately from the page layout.?
  5. Share the Streamlit and Python versions.
    Question : Streamlit does provide a direct method to control the width of a specific component like a DataFrame separately from the page layout.?

Name: streamlit
Version: 1.23.1
Python 3.7.16


Code

import streamlit as st
import pandas as pd

df = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})

with st.echo():
    st.dataframe(df, width=400)

    st.dataframe(df, width=600)

    st.dataframe(df, use_container_width=True)
1 Like

Thank You so much It’s working !!
You are great !! :heart_hands:

1 Like

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