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