Hi, I am a long time fan of Streamlit.
Recently I have been building my company’s main internal data application using Streamlit, highlighting the benefits of using Python and being able to ship faster.
Still, when I am presenting the application to other stakeholders - like board members - the application is just “not good looking”, especially the tables.
Having a good looking table like “Aggrid” would solve 99% of the “ugliness” of streamlit data_editor / dataframe, but aggrid is simply buggy and not maintained.
Has anyone dealt with such scenario? How did you make the tables “beautiful”?
Note that I know the purpose of Streamlit, which is to make data applications easier to build, but it would make my life 100% better if I could shift the focus of my data application to the actual analysis, and not the “poor” design of dataframes.
Hi Ferdy, thanks for the reply!
Yes it does, how did you do it?
I am thinking on using something like tailwind css to create some table component. The data editor seems a little raw in general.
this is a very beautiful example. Having something like this on streamlit would be incredible.
I have just added a Streamlit component that can render Pandas DataFrames as interactive DataTables to my ITables project:
from itables.streamlit import interactive_table
# Display a DF
interactive_table(df)
# Set a caption
interactive_table(df, caption="A Pandas DataFrame rendered as an interactive DataTable")
# AddCopy/CSV/Excel download buttons
interactive_table(df, buttons=["copyHtml5", "csvHtml5", "excelHtml5"])
Please note that ITables will downsample large tables by default (use the maxBytes argument to avoid this, or change the default, see Downsampling — Interactive Tables).
One of the current limitations is that, unlike in the notebook, we can’t seem to pass custom javascript callbacks to the Streamlit component. Is that something that would be an option in the above templated approach?
Oh I see that actually ITables’ to_html_datatable function also works in the html component (but then I need to set a height, and also the table takes longer to display as the library is loaded from the web, so interactive_table is probably the way to go even if I don’t have the JS callbacks, isn’t it?)
from itables.streamlit import interactive_table
from itables import to_html_datatable
from itables.sample_dfs import get_countries
from streamlit.components.v1 import html
import streamlit as st
st.set_page_config(layout="wide")
df = get_countries(html=False)
html(to_html_datatable(df, caption="Table rendered with to_html_datatable"), height=560)
interactive_table(df, caption="Table rendered with the streamlit component")
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.