I just tested and it seems that Streamlitās handling and a DataFrame Styler is not correclty handling df.style.hide(axis="index"). I would think that would be the best way to do it but alas:
import streamlit as st
import pandas as pd
df = pd.DataFrame({'A':[1,2,3],'B':['a','b','c']})
st.dataframe(df)
st.dataframe(df.style.hide(axis="index"))
st.markdown(df.style.hide(axis="index").to_html(), unsafe_allow_html=True)
That being the case, the Streamlit Documentation does tell you exactly the CSS trickery to accomplish this:
Edit: I see a note that that doesnāt work past version 1.10, and that I also skipped over where you already linked to it. Oops. The modern implementation is a lot less receptive to CSS hacks, but Iām fiddling.
Yeah, I think itās going to be hard to accomplish it through the st.dataframe method. The interactivity makes it much more complicated. Itās easy enough to accomplish with a static table as shown above, but interactive options havenāt come out pretty for me.
I tried converting to a plotly go.Table, but that only allows dragging and dropping columns without sorting.
I tried itables, and that does work, but it needs a lot of css styling to make it pretty.
Sorry I donāt have anything slick, but I think itās worth raising a bug on GitHub if itās not there already being that officially Streamlit is supposed to respect a pandas styler.
Thanks for your efforts. It is a little frustrating as this is usually a standard feature of these types of controls/ objects from my experience. The Streamlit app is only a temp solution until a more appropriate solution can be developed in one of our business systems. I will likely vote on the GitHub issue.