Hey! I love streamlitās built-in dataframe for many obvious reasons:
- Responsive for desktop & mobile
- You can always see column names & index names even when scrolling around
- Allows me to display my fancy dataframes with minimal headache
Background: I work in an industry thatās super opinionated on formatting its tables. Using pandas built-in styling, Iām able to achieve 99% of my needs (highlighting subtotals, formatting negatives with parentheses, all that jazz). However, all this pandas styling only applies to the values of the dataframe and not the index/column headers.
Request: Has anyone figured out a way to style the index & column header as well? Perhaps the below example highlights my issue. Iād like to make āTotal UCFā dark grey as Iāve already done with pandas styling. And Iād also like to make the headers āEntry, 2018, 2019,ā etc. dark blue & bold with white font. Any ideas?! (actual figures hidden b/c confidential)
I can (& have) achieved this with plotly tables. But theyāre a little less ideal because theyāre effectively static images without the magic of keeping the header & index in-place as the user scrolls around the dataframe. Any clue how to do this with the native st.dataframe()? Or something that behaves similarly (i.e. can do the three things bulleted above). Iām open to hacks and other libraries you may know, but the ideal would be Streamlit-native (but beggars canāt be choosers).