so i wanna make a table of my dataframe but i don’t know how to set the width of container that contain the table to fit the content
how to set the width of the container ?
so i wanna make a table of my dataframe but i don’t know how to set the width of container that contain the table to fit the content
how to set the width of the container ?
gb = GridOptionsBuilder.from_dataframe(new_dataframe)
gb.configure_default_column(
cellStyle={'color': 'black', 'fontWeight': 'bold', 'border': 'none'},
headerCellStyle={'background': 'white', 'text-align': 'center', 'border': 'none'}
)
gb.configure_grid_options(
rowStyle={'backgroundColor': 'white'},
domLayout='autoHeight',
suppressHorizontalScroll=True
)
for column in new_dataframe.columns:
gb.configure_column(column, autoSizeColumns=True)
grid_options = gb.build()
grid_options['fit_columns_on_grid_load'] = True
st.markdown("""
<style>
.ag-theme-streamlit {
width: 100% !important;
box-sizing: border-box;
}
</style>
""", unsafe_allow_html=True)
AgGrid(
new_dataframe,
gridOptions=grid_options,
theme='streamlit',
height=400,
style={'width': '100%'}
)
that is the code that i use i don’t know whats wrong
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.