Align text in "justify" alignment

image

Does streamlit has this option?

Thanks, keep up the awesome work!

Hey @somanyadav

You can use Markdown for it.
Here is a code sample to demonstrate the same -

import streamlit as st

st.markdown('<div style="text-align: center;">Hello World!</div>', unsafe_allow_html=True)
st.markdown('<div style="text-align: left;">Hello World!</div>', unsafe_allow_html=True)
st.markdown('<div style="text-align: right;">Hello World!</div>', unsafe_allow_html=True)
st.markdown('<div style="text-align: justify;">Hello World!</div>', unsafe_allow_html=True)

Happy Streamlit-ing!
Kanak

4 Likes

Thanks I got it @Kanak!

1 Like

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