DeepLearning101 commited on
Commit
51e3854
·
verified ·
1 Parent(s): ce341d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -25
app.py CHANGED
@@ -133,38 +133,35 @@ def check_login(user, password):
133
 
134
  # --- 🔥 [最終修正 CSS] 🔥 ---
135
  custom_css = """
136
- /* 1. 殺掉外層捲軸:強制隱藏外層容器的 overflow */
137
  #booking_table .wrap {
138
- overflow: hidden !important;
139
  }
140
 
141
- /* 2. 保留內層捲軸:只允許包覆表格的容器捲動 */
142
  #booking_table .table-wrap {
143
  overflow-x: auto !important;
144
  overflow-y: hidden !important;
145
  border: 1px solid #444 !important;
146
  }
147
 
148
- /* 3. 表格本體:
149
- width: max-content -> 強制撐開,不讓瀏覽器壓縮
150
- table-layout: fixed -> 嚴格遵守下方設定的寬度
151
  */
152
  #booking_table table {
153
  table-layout: fixed !important;
154
- width: max-content !important;
155
  border-collapse: collapse !important;
156
  margin: 0 !important;
157
  }
158
 
159
- /* 4. 欄位通用設定:
160
- white-space: normal -> 【關鍵】允許換行!
161
- word-break: break-word -> 確保長單字也能換行
162
- */
163
  #booking_table th, #booking_table td {
164
  display: table-cell !important;
165
- white-space: normal !important;
166
- overflow-wrap: break-word !important;
167
- word-break: break-word !important;
168
 
169
  vertical-align: top !important;
170
  box-sizing: border-box !important;
@@ -174,36 +171,38 @@ custom_css = """
174
  line-height: 1.4 !important;
175
  }
176
 
177
- /* 5. 🔥【完全依照您的指示固定寬度】🔥 */
 
 
178
 
179
- /* #1 id */
180
  #booking_table th:nth-child(1), #booking_table td:nth-child(1) { width: 60px !important; min-width: 60px !important; }
181
 
182
- /* #2 date */
183
  #booking_table th:nth-child(2), #booking_table td:nth-child(2) { width: 170px !important; min-width: 170px !important; }
184
 
185
- /* #3 time */
186
  #booking_table th:nth-child(3), #booking_table td:nth-child(3) { width: 80px !important; min-width: 80px !important; }
187
 
188
- /* #4 name */
189
  #booking_table th:nth-child(4), #booking_table td:nth-child(4) { width: 120px !important; min-width: 120px !important; }
190
 
191
- /* #5 tel */
192
  #booking_table th:nth-child(5), #booking_table td:nth-child(5) { width: 120px !important; min-width: 120px !important; }
193
 
194
- /* #6 email */
195
  #booking_table th:nth-child(6), #booking_table td:nth-child(6) { width: 250px !important; min-width: 250px !important; }
196
 
197
- /* #7 pax */
198
  #booking_table th:nth-child(7), #booking_table td:nth-child(7) { width: 50px !important; min-width: 50px !important; }
199
 
200
- /* #8 remarks */
201
  #booking_table th:nth-child(8), #booking_table td:nth-child(8) { width: 180px !important; min-width: 180px !important; }
202
 
203
- /* #9 status */
204
  #booking_table th:nth-child(9), #booking_table td:nth-child(9) { width: 120px !important; min-width: 120px !important; }
205
 
206
- /* #10 user_id */
207
  #booking_table th:nth-child(10), #booking_table td:nth-child(10) { width: 320px !important; min-width: 320px !important; }
208
  """
209
 
 
133
 
134
  # --- 🔥 [最終修正 CSS] 🔥 ---
135
  custom_css = """
136
+ /* 1. 殺掉外層捲軸 (綠色框框問題) */
137
  #booking_table .wrap {
138
+ overflow: hidden !important;
139
  }
140
 
141
+ /* 2. 保留內層捲軸 (紅色框框),這是唯一可以捲動的地方 */
142
  #booking_table .table-wrap {
143
  overflow-x: auto !important;
144
  overflow-y: hidden !important;
145
  border: 1px solid #444 !important;
146
  }
147
 
148
+ /* 3. 表格本體設定
149
+ min-width: 1500px -> 確保表格夠寬,強迫出現捲軸
150
+ table-layout: fixed -> 強制瀏覽器聽從下方的欄位寬度設定
151
  */
152
  #booking_table table {
153
  table-layout: fixed !important;
154
+ min-width: 1500px !important;
155
  border-collapse: collapse !important;
156
  margin: 0 !important;
157
  }
158
 
159
+ /* 4. 通用儲存格設定 */
 
 
 
160
  #booking_table th, #booking_table td {
161
  display: table-cell !important;
162
+ white-space: normal !important; /* ✅ 允許換行 */
163
+ overflow-wrap: break-word !important; /* ✅ 長單字換行 */
164
+ word-break: break-all !important;
165
 
166
  vertical-align: top !important;
167
  box-sizing: border-box !important;
 
171
  line-height: 1.4 !important;
172
  }
173
 
174
+ /* 5. 🔥【依照您的要求,固定每個欄位寬度】🔥 */
175
+ /* 注意:這裡同時設定 width 和 min-width 確保瀏覽器不會壓縮它
176
+ */
177
 
178
+ /* #1 id: 60px */
179
  #booking_table th:nth-child(1), #booking_table td:nth-child(1) { width: 60px !important; min-width: 60px !important; }
180
 
181
+ /* #2 date: 170px */
182
  #booking_table th:nth-child(2), #booking_table td:nth-child(2) { width: 170px !important; min-width: 170px !important; }
183
 
184
+ /* #3 time: 80px */
185
  #booking_table th:nth-child(3), #booking_table td:nth-child(3) { width: 80px !important; min-width: 80px !important; }
186
 
187
+ /* #4 name: 120px */
188
  #booking_table th:nth-child(4), #booking_table td:nth-child(4) { width: 120px !important; min-width: 120px !important; }
189
 
190
+ /* #5 tel: 120px */
191
  #booking_table th:nth-child(5), #booking_table td:nth-child(5) { width: 120px !important; min-width: 120px !important; }
192
 
193
+ /* #6 email: 250px */
194
  #booking_table th:nth-child(6), #booking_table td:nth-child(6) { width: 250px !important; min-width: 250px !important; }
195
 
196
+ /* #7 pax: 50px */
197
  #booking_table th:nth-child(7), #booking_table td:nth-child(7) { width: 50px !important; min-width: 50px !important; }
198
 
199
+ /* #8 remarks: 180px */
200
  #booking_table th:nth-child(8), #booking_table td:nth-child(8) { width: 180px !important; min-width: 180px !important; }
201
 
202
+ /* #9 status: 120px */
203
  #booking_table th:nth-child(9), #booking_table td:nth-child(9) { width: 120px !important; min-width: 120px !important; }
204
 
205
+ /* #10 user_id: 320px */
206
  #booking_table th:nth-child(10), #booking_table td:nth-child(10) { width: 320px !important; min-width: 320px !important; }
207
  """
208