JaMugen commited on
Commit
7b877c8
·
1 Parent(s): cc00532

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
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
- # Define CSS styles for table cells
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
- "<style> table { width: 100%; table-layout: fixed; } th, td { border: 1px solid black; word-wrap: break-word; } </style>",
 
 
 
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 style='{timestamp_style}'>{captions_list[i]['Timestamp']}</td>"
53
- f"<td style='{original_style}'>{captions_list[i]['Original']}</td></tr>",
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