Trying to display a table using plotly - st.plotly_chart

I am trying to display a table on my streamlit app using st.plotly_shart.
However, my tables displayed always is contained within the container with no horizontal scrolling capability. Also I cannot get to display the text as folded inside cells. Is there a way to resolve this?
The code used is something like this

covfig_sim = go.Figure(
                                    data=[
                                        go.Table(
                                            #columnwidth=[1, 1],
                                            columnwidth=[2,2],
                                            hoverlabel=dict(align='auto', ),
                                            header=dict(
                                                values=[f"<b>{i}</b>" for i in ft_col_list_wocov],
                                                font_color='white',
                                                font_size=12,
                                                align='left',
                                                height=18,
                                                fill_color='blue'
                                            ),
                                            cells=dict(
                                                values=featureCoverage_df[ft_col_list_wocov].transpose(),
                                                fill_color=color_df[ft_col_list_wocov].transpose(),
                                                # line_color="black",
                                                font_size=12,
                                                height=24,
                                                align='left',
                                                font_color='black'
                                            )
                                        )
                                    ]
                                )
                                st.plotly_chart(covfig_sim, use_container_width=True)

The table is rendered as follows:

Hi @bhawmik

Instead of using a data visualization library like plotly to display a table, you can consider using st.dataframe to do so and it supports horizontal scrolling also. You could also try to use Pandas styler to colorize columns or rows.

Hope this helps!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.