Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,22 +35,20 @@ def main():
|
|
| 35 |
start_index = st.session_state.get('start_index', 0)
|
| 36 |
end_index = start_index + 6
|
| 37 |
|
| 38 |
-
#
|
| 39 |
-
timestamp_style = "padding: 8px; background-color: rgb(255, 0, 0); color: rgb(118, 133, 123); display: flex; align-items: center;"
|
| 40 |
-
original_style = "padding: 8px; background-color: rgb(0, 0, 0); color: rgb(255, 255, 255); display: flex; align-items: center;"
|
| 41 |
-
|
| 42 |
-
# Display caption table
|
| 43 |
st.write("## Caption Table")
|
| 44 |
st.write(
|
| 45 |
-
"<
|
|
|
|
|
|
|
|
|
|
| 46 |
unsafe_allow_html=True,
|
| 47 |
)
|
| 48 |
-
st.write("<table><tr><th style='width: 50%;'>Timestamp</th><th style='width: 50%;'>Original</th></tr>", unsafe_allow_html=True)
|
| 49 |
|
| 50 |
for i in range(start_index, min(end_index, len(captions_list))):
|
| 51 |
st.write(
|
| 52 |
-
f"<tr><td
|
| 53 |
-
f"<td
|
| 54 |
unsafe_allow_html=True,
|
| 55 |
)
|
| 56 |
|
|
|
|
| 35 |
start_index = st.session_state.get('start_index', 0)
|
| 36 |
end_index = start_index + 6
|
| 37 |
|
| 38 |
+
# Display caption table with CSS class names
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
st.write("## Caption Table")
|
| 40 |
st.write(
|
| 41 |
+
"<link rel='stylesheet' href='styles.css'>", unsafe_allow_html=True
|
| 42 |
+
)
|
| 43 |
+
st.write(
|
| 44 |
+
"<table><tr><th class='timestamp'>Timestamp</th><th class='original'>Original</th></tr>",
|
| 45 |
unsafe_allow_html=True,
|
| 46 |
)
|
|
|
|
| 47 |
|
| 48 |
for i in range(start_index, min(end_index, len(captions_list))):
|
| 49 |
st.write(
|
| 50 |
+
f"<tr><td class='timestamp'>{captions_list[i]['Timestamp']}</td>"
|
| 51 |
+
f"<td class='original'>{captions_list[i]['Original']}</td></tr>",
|
| 52 |
unsafe_allow_html=True,
|
| 53 |
)
|
| 54 |
|