Table font size

Hello everybody! I’m developing an app to help a small and local food (vegetables and fruits) producer. We have an group which we support with a fix payment, so he is not subject to climatic variations that result in losses because the payment is guarantee. The same for when we have extra production and lots of products, we can share with our friends and community. Also, we can enjoy fresh air visiting and helping with the work of the small farm. >>> Thank you so much Streamlit community to allow this experience! :grinning:
The app is being used by 20 people of different ages…so one thing that would be essential is a larger font size for the tables.

As far as I got it, until this moment it is not possible to configure it. But is there any way to bypass this and adjust a larger font size for the streamlit.table() ?

The app:
It is in Portuguese and the quality of images is not good because the main proposal is to use in mobiles.

Hi @renato-favarin,

Thank you for sharing with the Streamlit community!

I would recommend checking out this post which provides an example of using markdown to adjust font size and style.

Please let me know if you have any questions.



1 Like

Thank you @Caroline .
I tried to adjust with the indicated parameters to the streamlit.table() command.I also tried to pass a df.styles but it didn’t work since it reproduced a standard table, from a regular dataframe (instead of using the configurated style)
Also, I tried to use a df.styles inside the st.dataframe() but it didn’t work as well.

Maybe it is really not possible to increase the font size of tables.
I’m totally new at Streamlit, do you know if it is possible to open a kindly request and how to do this?

Thank you!

Hi @renato-favarin,

Can you share a code snippet which shows the markdown you attempted to add?



Hello @Caroline !

The function "“gera_tabela” generates the table
The blanks ( " " ) columns are just to the single column be close to the middle of screen, instead totally in the right.
I tried different things and I wasn’t able to increase the font size of the table.

 def gera_tabela(df, label):
    df.index = [" "] * len(df)

    df['na_terra'] = " "
    df['na_cesta'] = " "
    df['  '] =  " "
    df.rename({'produto':label,'na_terra': '   ', 'na_cesta':' '}, axis='columns', inplace=True)
    st.table(df[[label, '   ', '  ',' ']])

 if st.checkbox(f"Na cesta em {data}",value=False):
    na_cesta = dados_csa.query("na_cesta == 'x'")
    gera_tabela(na_cesta, f'--provável cesta em {data} (sujeito à adições)--')


Hello @Caroline, did you have any chance to look at my reply? Thank you very much!

Hi @renato-favarin,

It doesn’t look like the code snippet you posted shows the markdown you tried to use to change the font size. Have you tried something like the following?

st.markdown(""" <style> .font {
</style> """, unsafe_allow_html=True)