'Text align in streamlit st.info information box

How to align text (justify) in streamlit information box(st.info)

import streamlit as st

# Generate Three equal columns
c1, c2, c3 = st.columns((1, 1, 1))

with c1:
    st.info("""Streamlit is more than just a way to make data apps, it's also a community of creators that share their apps and ideas and help each other make their work better. Please come join us on the community forum. We love to hear your questions, ideas, and help you work through your bugs — stop by today!""") 

enter image description here



Solution 1:[1]

Apply a style.

Code

import streamlit as st

mystyle = '''
    <style>
        p {
            text-align: justify;
        }
    </style>
    '''

st.markdown(mystyle, unsafe_allow_html=True)

# Generate Three equal columns
c1, c2, c3 = st.columns((1, 1, 1))

with c1:
    st.info("""Streamlit is more than just a way to make data apps, 
            it's also a community of creators that share their apps 
            and ideas and help each other make their work better. Please 
            come join us on the community forum. We love to hear your questions, 
            ideas, and help you work through your bugs — stop by today!""")

Output

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ferdy