Update space
Browse files
app.py
CHANGED
@@ -53,40 +53,40 @@ def extract_table(url):
|
|
53 |
'Topic': cells[1].text.strip(),
|
54 |
})
|
55 |
|
56 |
-
#
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
|
91 |
# Generate choices for dropdown
|
92 |
choices = [f"{row['Topic']} ({row['Date']})" for row in data]
|
|
|
53 |
'Topic': cells[1].text.strip(),
|
54 |
})
|
55 |
|
56 |
+
#Create HTML table
|
57 |
+
html = '''
|
58 |
+
<style>
|
59 |
+
.dataframe {
|
60 |
+
border-collapse: collapse;
|
61 |
+
width: 100%;
|
62 |
+
margin: 10px 0;
|
63 |
+
}
|
64 |
+
.dataframe th, .dataframe td {
|
65 |
+
border: 1px solid #ddd;
|
66 |
+
padding: 8px;
|
67 |
+
text-align: left;
|
68 |
+
}
|
69 |
+
.dataframe th {
|
70 |
+
background-color: #f6f8fa;
|
71 |
+
}
|
72 |
+
.dataframe tr:nth-child(even) {
|
73 |
+
background-color: #f9f9f9;
|
74 |
+
}
|
75 |
+
</style>
|
76 |
+
'''
|
77 |
|
78 |
+
html += '<table class="dataframe">'
|
79 |
+
html += '<thead><tr><th>Date</th><th>Topic</th></tr></thead>'
|
80 |
+
html += '<tbody>'
|
81 |
|
82 |
+
for row in data:
|
83 |
+
html += f'''
|
84 |
+
<tr>
|
85 |
+
<td>{row['Date']}</td>
|
86 |
+
<td>{row['Topic']}</td>
|
87 |
+
</tr>
|
88 |
+
'''
|
89 |
+
html += '</tbody></table>'
|
90 |
|
91 |
# Generate choices for dropdown
|
92 |
choices = [f"{row['Topic']} ({row['Date']})" for row in data]
|