VyLala commited on
Commit
d9ef8dd
·
verified ·
1 Parent(s): 2d140ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -6
app.py CHANGED
@@ -1147,19 +1147,26 @@ with gr.Blocks() as interface:
1147
  # <thead style='position: sticky; top: 0; background-color: #2c2c2c; z-index: 1;'>
1148
  # <tr>
1149
  # """
 
1150
  html = """
1151
  <div style='overflow-x: auto; padding: 10px;'>
1152
  <div style='max-height: 400px; overflow-y: auto; border: 1px solid #ccc; border-radius: 8px;'>
1153
- <table style='width:100%; border-collapse: collapse; table-layout: auto; font-size: 14px; color: inherit; background-color: inherit;'>
1154
- """
1155
 
1156
  headers = ["No.", "Sample ID", "Predicted Country", "Country Explanation", "Predicted Sample Type", "Sample Type Explanation", "Sources", "Time cost"]
 
 
 
 
 
1157
  html += "".join(
1158
- f"<th style='padding: 10px; border: 1px solid #555; text-align: left; white-space: nowrap;'>{h}</th>"
1159
- for h in headers
1160
- )
1161
  html += "</tr></thead><tbody>"
1162
-
 
1163
  for idx, row in enumerate(rows, 1): # start numbering from 1
1164
  html += "<tr>"
1165
  html += f"<td style='padding: 10px; border: 1px solid #555;'>{idx}</td>" # "No." column
 
1147
  # <thead style='position: sticky; top: 0; background-color: #2c2c2c; z-index: 1;'>
1148
  # <tr>
1149
  # """
1150
+
1151
  html = """
1152
  <div style='overflow-x: auto; padding: 10px;'>
1153
  <div style='max-height: 400px; overflow-y: auto; border: 1px solid #ccc; border-radius: 8px;'>
1154
+ <table style='width:100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; color: inherit; background-color: inherit;'>
1155
+ """
1156
 
1157
  headers = ["No.", "Sample ID", "Predicted Country", "Country Explanation", "Predicted Sample Type", "Sample Type Explanation", "Sources", "Time cost"]
1158
+ # html += "".join(
1159
+ # f"<th style='padding: 10px; border: 1px solid #555; text-align: left; white-space: nowrap;'>{h}</th>"
1160
+ # for h in headers
1161
+ # )
1162
+ html += "<thead style='position: sticky; top: 0; background-color: #2c2c2c; z-index: 1;'><tr>"
1163
  html += "".join(
1164
+ f"<th style='padding: 10px; border: 1px solid #555; text-align: left; white-space: nowrap;'>{h}</th>"
1165
+ for h in headers
1166
+ )
1167
  html += "</tr></thead><tbody>"
1168
+
1169
+
1170
  for idx, row in enumerate(rows, 1): # start numbering from 1
1171
  html += "<tr>"
1172
  html += f"<td style='padding: 10px; border: 1px solid #555;'>{idx}</td>" # "No." column