DeepLearning101 commited on
Commit
51a7e20
·
verified ·
1 Parent(s): 7bf7640

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -8
app.py CHANGED
@@ -133,24 +133,35 @@ def check_login(user, password):
133
  error_msg: "<span style='color: red'>❌ 帳號或密碼錯誤</span>"
134
  }
135
 
136
- # --- 🔥 新增 CSS:強制表格寬度與捲軸 (加強版) ---
137
  custom_css = """
138
- .table-wrap {
 
139
  overflow-x: auto !important;
140
  }
141
 
 
142
  table {
143
- min-width: 1500px !important;
144
- table-layout: auto !important;
 
145
  }
146
 
 
147
  td, th {
148
  white-space: nowrap !important;
149
  overflow: visible !important;
150
- text-overflow: unset !important;
151
- max-width: none !important;
152
- width: auto !important;
153
- padding: 10px !important;
 
 
 
 
 
 
 
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