Streamlit aggrid encounter table style formating

i am working on aggrid and use a a very simple code look

from st_aggrid import AgGrid
import pandas as pd

df = pd.read_json("https://www.ag-grid.com/example-assets/olympic-winners.json")
grid_return = AgGrid(df)

this is in json i did use excel and csv file but my table format is not working properly please help me what is this.
this is the picture that it should look like this

but when i use the same code it look like this


can anyone tell me what happened here why its happening i did multiple work by using height width things and changing its style but still its not working properly.

Hey @Waleed_Ahmed, welcome to our community!

I see you’re using a Streamlit aggrid. Why not use our native dataframe option instead?

Best,
Charly

well thanks for your reply sir but sometime you know we need to work on different things according to our learning project and user requirement let me clear to you i am working on a project that is already build and having trouble on aggrid table formating idk what is happening but i did use aggrid on multiple system but still this problem persist and am bound to use aggrid please let me know if you have any solution of my problem.

sir please let me know and help me.

I ran that code and it rendered exactly as expected, which is none of your screenshots. You must be doing something else but I don’t know what it can be.

i am not doing anything let me tell you i am working on python 3.12 and create env with it then pip install streamlit and st_aggrid, but this thing happend.

can you tell me what kind of things may cause this ?

I deployed that code to streamlit cloud:

It renders as expected for me. Doesn’t it for you?

okay well thank you for your help.

So does my app render OK for you?

yes your app does it i think i did install library with aggrid that make it hindrance to create proper table.

Not sure what you mean here. Of course you need to install streamlit-aggrid for the application to work. I had to install it too, you can see it in my requirements file.

Thanks for the help, @Goyo! :raised_hands: