create a data frame with fake columns: a string and a number, then use pandas style to left align the numbers
Drop files here
or click to upload
import pandas as pd
# Create a DataFrame with fake data
data = {
'Category': ['A', 'B', 'C', 'D', 'E'],
'Values': [1000, 1500, 2000, 2500, 3000]
}
data_df = pd.DataFrame(data)
# Left align the numbers in the 'Values' column using pandas style
styled_df = data_df.style.set_table_styles([dict(selector='th', props=[('text-align', 'left')])])
styled_df = styled_df.set_properties(**{'text-align': 'left'})
import streamlit as st
st.dataframe(styled_df)
st.write(styled_df)
st.table(styled_df)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?