Spaces:
Sleeping
Sleeping
File size: 566 Bytes
3698d0a 6aa1c8b 3698d0a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import streamlit as st
def create_table(df):
# Table header based on df columns
header = "| " + " | ".join(df.columns) + " |"
# Number of columns in df to set table divider accordingly
divider = "|:---|" + "|-----:|" * len(df.columns[:-1])
rows = [header, divider]
for _, row in df.iterrows():
rows.append("| " + " | ".join(row.astype(str)) + " |")
return "\n".join(rows)
def header3(text):
st.markdown(f"### {text}")
def header4(text):
st.markdown(f"#### {text}")
def header5(text):
st.markdown(f"##### {text}") |