0
import pandas as pd
import streamlit as st

df = pd.read_csv('data/AUDCAD_1h.csv', index_col=0)

st.dataframe(df, use_container_width=True)

The font size is too small for me when I publish pandas dataframe with streamlit. I tried to adjust with css but no success.

enter image description here

I am able to adjust font size with st.table but that does not give a sorting feature and therefore would appreciate if anyone can guide me on how to adjust font size of dataframe produced by st.dataframe and st.write.

dbmtbm
  • 35
  • 1
  • 3

1 Answers1

0

Using the "wide" layout, the column edition and sorting still work. It does not allow to control precisely the font size, but it can then be done via the browser. Try to add this line at the beginning of your script after the imports:

st.set_page_config(layout="wide")
matleg
  • 618
  • 4
  • 11
  • st.set_page_config(layout="wide") this would only widen the page layout but has no significance on font size.... I am wondering if there is way to control it through CSS styling!!! – dbmtbm Jun 22 '23 at 10:19