LakshmiHarika commited on
Commit
0e24431
·
verified ·
1 Parent(s): 24ab87f

Update pages/Data Collection.py

Browse files
Files changed (1) hide show
  1. pages/Data Collection.py +7 -32
pages/Data Collection.py CHANGED
@@ -105,41 +105,16 @@ if data_type == "Structured Data":
105
  A database of students with fields like ID, name, age, and gender:
106
  """)
107
 
108
- # Corrected table for the Student database example
109
- student_data = {
110
  "Id": [100, 101, 102, 103],
111
  "Name": ["Lakshmi Harika", "Varshitha", "Hari Chandan", "Shamitha"],
112
  "Age": [22, 23, 22, 23],
113
  "Gender": ["Female", "Female", "Male", "Female"]
114
  }
115
  df = pd.DataFrame(student_data)
116
- st.table(df)
117
-
118
- # Additional CSS for the Table (Optional, if needed)
119
- st.markdown("""
120
- <style>
121
- table {
122
- width: 100%;
123
- border-collapse: collapse;
124
- text-align: left;
125
- }
126
- th {
127
- padding: 10px;
128
- border: 1px solid #dddddd;
129
- background-color: #ffc87c;
130
- color: #000000;
131
- text-align: center;
132
- }
133
- td:nth-child(1) {
134
- font-weight: bold;
135
- }
136
- td {
137
- padding: 10px;
138
- border: 1px solid #dddddd;
139
- vertical-align: top;
140
- }
141
- td:nth-child(2), td:nth-child(3) {
142
- width: 40%;
143
- }
144
- </style>
145
- """, unsafe_allow_html=True)
 
105
  A database of students with fields like ID, name, age, and gender:
106
  """)
107
 
108
+ student_data = {
 
109
  "Id": [100, 101, 102, 103],
110
  "Name": ["Lakshmi Harika", "Varshitha", "Hari Chandan", "Shamitha"],
111
  "Age": [22, 23, 22, 23],
112
  "Gender": ["Female", "Female", "Male", "Female"]
113
  }
114
  df = pd.DataFrame(student_data)
115
+ st.markdown(df.style.set_table_styles(
116
+ [{
117
+ 'selector': 'thead th',
118
+ 'props': 'font-weight: bold;'
119
+ }]
120
+ ).hide(axis="index").to_html(), unsafe_allow_html=True)