Update app.py
Browse files
app.py
CHANGED
|
@@ -133,24 +133,35 @@ def check_login(user, password):
|
|
| 133 |
error_msg: "<span style='color: red'>❌ 帳號或密碼錯誤</span>"
|
| 134 |
}
|
| 135 |
|
| 136 |
-
# --- 🔥
|
| 137 |
custom_css = """
|
| 138 |
-
.
|
|
|
|
| 139 |
overflow-x: auto !important;
|
| 140 |
}
|
| 141 |
|
|
|
|
| 142 |
table {
|
| 143 |
-
|
| 144 |
-
|
|
|
|
| 145 |
}
|
| 146 |
|
|
|
|
| 147 |
td, th {
|
| 148 |
white-space: nowrap !important;
|
| 149 |
overflow: visible !important;
|
| 150 |
-
text-overflow:
|
| 151 |
-
max-width: none !important;
|
| 152 |
-
width: auto !important;
|
| 153 |
-
padding:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
}
|
| 155 |
"""
|
| 156 |
|
|
|
|
| 133 |
error_msg: "<span style='color: red'>❌ 帳號或密碼錯誤</span>"
|
| 134 |
}
|
| 135 |
|
| 136 |
+
# --- 🔥 [終極修正 CSS]:使用 max-content 強制撐開 ---
|
| 137 |
custom_css = """
|
| 138 |
+
/* 1. 確保外層容器可以捲動 */
|
| 139 |
+
.table-wrap, .wrap, .svelte-12cmxck, div[data-testid="dataframe"] > div {
|
| 140 |
overflow-x: auto !important;
|
| 141 |
}
|
| 142 |
|
| 143 |
+
/* 2. 核心:強制表格寬度為「內容總寬度」,不要被螢幕寬度限制 */
|
| 144 |
table {
|
| 145 |
+
width: max-content !important;
|
| 146 |
+
min-width: 100% !important;
|
| 147 |
+
table-layout: auto !important;
|
| 148 |
}
|
| 149 |
|
| 150 |
+
/* 3. 單元格設定:不換行、顯示完整文字 */
|
| 151 |
td, th {
|
| 152 |
white-space: nowrap !important;
|
| 153 |
overflow: visible !important;
|
| 154 |
+
text-overflow: clip !important; /* 移除 ... */
|
| 155 |
+
max-width: none !important;
|
| 156 |
+
width: auto !important;
|
| 157 |
+
padding: 12px !important; /* 增加間距比較好點擊 */
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
/* 4. 針對 Gradio 內部的 span 文字容器也強制不換行 */
|
| 161 |
+
td > span, th > span {
|
| 162 |
+
white-space: nowrap !important;
|
| 163 |
+
overflow: visible !important;
|
| 164 |
+
text-overflow: clip !important;
|
| 165 |
}
|
| 166 |
"""
|
| 167 |
|