I am a newbie, i’ll say that right up front. I am trying to set the width of a grid in pixels. Nothing seems to affect the width. I only have one column of text read in from a cvs file. The column of text correctly shrinks to the fits size - which is great. But the header for that one column extends far to the right as if there were several more columns - but of course there are not. This seem like it would be very easy… but its got me stumped.
To test you need to create a cvs file called sample.cvs and paste in the following 5 lines:
BTW is there no way to upload files other than images?
Here’s the py code:
import altair as alt
from itertools import cycle
from st_aggrid import GridOptionsBuilder, AgGrid, GridUpdateMode, DataReturnMode, JsCode
#replace path in the following line with actual path to sampe.cvs
df = pd.read_csv(‘/path/to/sample.csv’)
selection_mode = ‘multiple’
gb = GridOptionsBuilder.from_dataframe(df)
gridOptions = gb.build()
grid_response = AgGrid(
selected = grid_response[‘selected_rows’]
selected_df = pd.DataFrame(selected)