-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathTable.py
24 lines (19 loc) · 858 Bytes
/
Table.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pandas as pd
import streamlit_shadcn_ui as ui
import streamlit as st
st.header("Table")
with open("docs/components/table.md", "r") as f:
st.markdown(f.read())
# Sample data
data = [
{"invoice": "INV001", "paymentStatus": "Paid", "totalAmount": 500, "paymentMethod": "Credit Card"},
{"invoice": "INV002", "paymentStatus": "Unpaid", "totalAmount": 200, "paymentMethod": "Cash"},
{"invoice": "INV003", "paymentStatus": "Paid", "totalAmount": 150, "paymentMethod": "Debit Card"},
{"invoice": "INV004", "paymentStatus": "Unpaid", "totalAmount": 350, "paymentMethod": "Credit Card"},
{"invoice": "INV005", "paymentStatus": "Paid", "totalAmount": 400, "paymentMethod": "PayPal"},
# Add more records as needed
]
# Creating a DataFrame
invoice_df = pd.DataFrame(data)
ui.table(data=invoice_df, maxHeight=300)
st.write(ui.table)