I am trying to make a table using the beta_expander
. It works though I am having some issues when using long texts. This is illustrated in the picture below:
The data is not quite aligning with each other. The latter two columns are higher than the first column. I also tried creating gaps using col[0].write(" ")
though the results were not satisfactory. Just for the sake of trying, I also tried use_container_width=True
but it had no effect. Is there a way to align the layouts with each other?
This is my code:
with st.beta_expander("COVID-19 Data"): colss = st.beta_columns(3) colss[0].markdown("#### Dataset") colss[1].markdown("#### Country") colss[2].markdown("#### Source") cols = st.beta_columns(3) cols[0].write('Social Impact') cols[1].write('United Kingdom') cols[2].write('ONS') cols[0].write('Economic Impact') cols[1].write('United Kingdom') cols[2].write('ONS') cols[0].write('UK spending on credit and debit cards',use_container_width=True) cols[1].write('United Kingdom') cols[1].write("") cols[1].write("") cols[2].write('ONS') cols[0].write('Online weekly price changes') cols[1].write('United Kingdom') cols[2].write('ONS') cols[0].write('Infections in the community in England') cols[1].write('United Kingdom') cols[1].write("") cols[2].write('ONS') cols[0].write('Business insights and impact on the UK economy',use_container_width=True) cols[1].write('United Kingdom') cols[2].write('ONS') cols[0].write('Weekly shipping indicators') cols[1].write('United Kingdom') cols[2].write('ONS') cols[0].write('Deaths registered weekly in England and Wales, provisional',use_container_width=True) cols[1].write('United Kingdom') cols[2].write('ONS') cols[2].write("") cols[2].write("") cols[0].write('Number of deaths in care homes notified to the Care Quality Commission, England',use_container_width=True) cols[1].write('United Kingdom') cols[2].write('ONS') cols[0].write('Death registrations and occurrences by local authority and health board') cols[1].write('United Kingdom') cols[2].write('ONS') cols[0].write('Care home resident deaths registered in England and Wales, provisional') cols[1].write('United Kingdom') cols[2].write('ONS') cols[0].write('Coronavirus and homeschooling in Great Britain') cols[1].write('United Kingdom') cols[2].write('ONS') cols[0].write('Online job advert estimates') cols[1].write('United Kingdom') cols[2].write('ONS') cols[0].write('Coronavirus (COVID-19) antibody data for the UK') cols[1].write('United Kingdom') cols[2].write('ONS')