Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -100,17 +100,24 @@ def main_page(furniture_data):
|
|
| 100 |
"""
|
| 101 |
st.markdown(video_html, unsafe_allow_html=True)
|
| 102 |
with col3:
|
|
|
|
| 103 |
table_css = """
|
| 104 |
<style>
|
| 105 |
-
.
|
| 106 |
width: 100%;
|
| 107 |
-
max-
|
| 108 |
-
max-height: 200px;
|
| 109 |
overflow-y: auto;
|
| 110 |
-
display: block;
|
| 111 |
}
|
| 112 |
-
.dataframe
|
| 113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
}
|
| 115 |
</style>
|
| 116 |
"""
|
|
@@ -119,7 +126,8 @@ def main_page(furniture_data):
|
|
| 119 |
video_metadata = videos_data[source_video]
|
| 120 |
# Convert the metadata dictionary to a DataFrame
|
| 121 |
metadata_df = pd.DataFrame(video_metadata.items(), columns=['Attribute', 'Value'])
|
| 122 |
-
|
|
|
|
| 123 |
|
| 124 |
else:
|
| 125 |
st.write("Not Trending")
|
|
|
|
| 100 |
"""
|
| 101 |
st.markdown(video_html, unsafe_allow_html=True)
|
| 102 |
with col3:
|
| 103 |
+
# Custom CSS to style the table
|
| 104 |
table_css = """
|
| 105 |
<style>
|
| 106 |
+
.stDataFrame {
|
| 107 |
width: 100%;
|
| 108 |
+
max-height: 300px;
|
|
|
|
| 109 |
overflow-y: auto;
|
|
|
|
| 110 |
}
|
| 111 |
+
table.dataframe {
|
| 112 |
+
border-collapse: collapse;
|
| 113 |
+
}
|
| 114 |
+
table.dataframe th, table.dataframe td {
|
| 115 |
+
border: 1px solid #ddd;
|
| 116 |
+
padding: 8px;
|
| 117 |
+
text-align: left;
|
| 118 |
+
}
|
| 119 |
+
table.dataframe th {
|
| 120 |
+
background-color: #f2f2f2;
|
| 121 |
}
|
| 122 |
</style>
|
| 123 |
"""
|
|
|
|
| 126 |
video_metadata = videos_data[source_video]
|
| 127 |
# Convert the metadata dictionary to a DataFrame
|
| 128 |
metadata_df = pd.DataFrame(video_metadata.items(), columns=['Attribute', 'Value'])
|
| 129 |
+
# Display the DataFrame with custom CSS
|
| 130 |
+
st.markdown(table_css + metadata_df.to_html(index=False), unsafe_allow_html=True)
|
| 131 |
|
| 132 |
else:
|
| 133 |
st.write("Not Trending")
|