Update app.py
Browse files
app.py
CHANGED
|
@@ -353,47 +353,62 @@ with gr.Blocks() as demo:
|
|
| 353 |
comp_reset_btn.click(reset_comp, None, [comp_standard, comp_version, comp_category])
|
| 354 |
|
| 355 |
# --------------------------
|
| 356 |
-
# CSS (이미지 포함 개선)
|
| 357 |
# --------------------------
|
| 358 |
-
css = """
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
--------------------------
|
| 365 |
-
|
| 366 |
-
--------------------------
|
| 367 |
-
table th:nth-child(
|
| 368 |
-
table th:nth-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
------
|
| 374 |
-
table th:nth-child(
|
| 375 |
-
table th:nth-child(
|
| 376 |
-
table th:nth-child(
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 382 |
thead th {
|
| 383 |
position: sticky;
|
| 384 |
top: 0;
|
| 385 |
-
background: white;
|
|
|
|
|
|
|
| 386 |
.dataframe {
|
| 387 |
max-height: none !important;
|
| 388 |
-
overflow-y: visible !important;
|
|
|
|
| 389 |
.dataframe > div {
|
| 390 |
max-height: none !important;
|
| 391 |
-
overflow: visible !important;
|
|
|
|
| 392 |
td {
|
| 393 |
white-space: normal !important;
|
| 394 |
word-break: break-word !important;
|
| 395 |
-
line-height: 1.6;
|
| 396 |
-
|
|
|
|
|
|
|
| 397 |
if __name__ == "__main__":
|
| 398 |
demo.launch(
|
| 399 |
theme=gr.themes.Soft(),
|
|
|
|
| 353 |
comp_reset_btn.click(reset_comp, None, [comp_standard, comp_version, comp_category])
|
| 354 |
|
| 355 |
# --------------------------
|
| 356 |
+
# CSS (이미지 포함 및 동적 컬럼 너비 개선)
|
| 357 |
# --------------------------
|
| 358 |
+
css = """
|
| 359 |
+
table {
|
| 360 |
+
table-layout: fixed !important;
|
| 361 |
+
width: 100% !important;
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
/* -------------------------- */
|
| 365 |
+
/* 2컬럼 (단일 조회) */
|
| 366 |
+
/* -------------------------- */
|
| 367 |
+
table th:nth-last-child(2):first-child, table td:nth-last-child(2):first-child { width: 15% !important; }
|
| 368 |
+
table th:nth-last-child(1), table td:nth-last-child(1) { width: 85% !important; }
|
| 369 |
+
|
| 370 |
+
/* -------------------------- */
|
| 371 |
+
/* 4컬럼 (비교) */
|
| 372 |
+
/* -------------------------- */
|
| 373 |
+
table th:nth-child(1):nth-last-child(4), table td:nth-child(1):nth-last-child(4) { width: 7% !important; }
|
| 374 |
+
table th:nth-child(2):nth-last-child(3), table td:nth-child(2):nth-last-child(3) { width: 43% !important; }
|
| 375 |
+
table th:nth-child(3):nth-last-child(2), table td:nth-child(3):nth-last-child(2) { width: 7% !important; }
|
| 376 |
+
table th:nth-child(4):nth-last-child(1), table td:nth-child(4):nth-last-child(1) { width: 43% !important; }
|
| 377 |
+
|
| 378 |
+
/* -------------------------- */
|
| 379 |
+
/* 6컬럼 (TableA 등) */
|
| 380 |
+
/* -------------------------- */
|
| 381 |
+
table th:nth-child(1):nth-last-child(6), table td:nth-child(1):nth-last-child(6) { width: 8% !important; }
|
| 382 |
+
table th:nth-child(2):nth-last-child(5), table td:nth-child(2):nth-last-child(5) { width: 25% !important; }
|
| 383 |
+
table th:nth-child(3):nth-last-child(4), table td:nth-child(3):nth-last-child(4) { width: 8% !important; }
|
| 384 |
+
table th:nth-child(4):nth-last-child(3), table td:nth-child(4):nth-last-child(3) { width: 25% !important; }
|
| 385 |
+
table th:nth-child(5):nth-last-child(2), table td:nth-child(5):nth-last-child(2) { width: 8% !important; }
|
| 386 |
+
table th:nth-child(6):nth-last-child(1), table td:nth-child(6):nth-last-child(1) { width: 26% !important; }
|
| 387 |
+
|
| 388 |
+
/* -------------------------- */
|
| 389 |
+
/* 기본 테이블 스타일 */
|
| 390 |
+
/* -------------------------- */
|
| 391 |
thead th {
|
| 392 |
position: sticky;
|
| 393 |
top: 0;
|
| 394 |
+
background: white;
|
| 395 |
+
z-index: 10; /* 스크롤 시 텍스트 겹침 방지 */
|
| 396 |
+
}
|
| 397 |
.dataframe {
|
| 398 |
max-height: none !important;
|
| 399 |
+
overflow-y: visible !important;
|
| 400 |
+
}
|
| 401 |
.dataframe > div {
|
| 402 |
max-height: none !important;
|
| 403 |
+
overflow: visible !important;
|
| 404 |
+
}
|
| 405 |
td {
|
| 406 |
white-space: normal !important;
|
| 407 |
word-break: break-word !important;
|
| 408 |
+
line-height: 1.6;
|
| 409 |
+
padding: 10px;
|
| 410 |
+
}
|
| 411 |
+
"""
|
| 412 |
if __name__ == "__main__":
|
| 413 |
demo.launch(
|
| 414 |
theme=gr.themes.Soft(),
|