Update app.py
Browse files
app.py
CHANGED
|
@@ -131,14 +131,14 @@ def check_login(user, password):
|
|
| 131 |
error_msg: "<span style='color: red'>❌ 帳號或密碼錯誤</span>"
|
| 132 |
}
|
| 133 |
|
| 134 |
-
# --- 🔥 [
|
| 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;
|
|
@@ -146,20 +146,19 @@ custom_css = """
|
|
| 146 |
}
|
| 147 |
|
| 148 |
/* 3. 表格本體:
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
table-layout: fixed -> 嚴格遵守下方設定的欄位寬度。
|
| 152 |
*/
|
| 153 |
#booking_table table {
|
| 154 |
table-layout: fixed !important;
|
| 155 |
-
|
| 156 |
border-collapse: collapse !important;
|
| 157 |
margin: 0 !important;
|
| 158 |
}
|
| 159 |
|
| 160 |
/* 4. 欄位通用設定:
|
| 161 |
-
white-space: normal ->
|
| 162 |
-
|
| 163 |
*/
|
| 164 |
#booking_table th, #booking_table td {
|
| 165 |
display: table-cell !important;
|
|
@@ -175,39 +174,37 @@ custom_css = """
|
|
| 175 |
line-height: 1.4 !important;
|
| 176 |
}
|
| 177 |
|
| 178 |
-
/* 5.
|
| 179 |
-
這些寬度加總起來大約是 1600px,會剛好撐滿上面的 min-width
|
| 180 |
-
*/
|
| 181 |
|
| 182 |
-
/* #1 id
|
| 183 |
-
#booking_table th:nth-child(1), #booking_table td:nth-child(1) { width: 60px !important; }
|
| 184 |
|
| 185 |
-
/* #2 date
|
| 186 |
-
#booking_table th:nth-child(2), #booking_table td:nth-child(2) { width: 170px !important; }
|
| 187 |
|
| 188 |
-
/* #3 time
|
| 189 |
-
#booking_table th:nth-child(3), #booking_table td:nth-child(3) { width: 80px !important; }
|
| 190 |
|
| 191 |
-
/* #4 name
|
| 192 |
-
#booking_table th:nth-child(4), #booking_table td:nth-child(4) { width: 120px !important; }
|
| 193 |
|
| 194 |
-
/* #5 tel
|
| 195 |
-
#booking_table th:nth-child(5), #booking_table td:nth-child(5) { width: 120px !important; }
|
| 196 |
|
| 197 |
-
/* #6 email
|
| 198 |
-
#booking_table th:nth-child(6), #booking_table td:nth-child(6) { width: 250px !important; }
|
| 199 |
|
| 200 |
-
/* #7 pax
|
| 201 |
-
#booking_table th:nth-child(7), #booking_table td:nth-child(7) { width: 50px !important; }
|
| 202 |
|
| 203 |
-
/* #8 remarks
|
| 204 |
-
#booking_table th:nth-child(8), #booking_table td:nth-child(8) { width: 180px !important; }
|
| 205 |
|
| 206 |
-
/* #9 status
|
| 207 |
-
#booking_table th:nth-child(9), #booking_table td:nth-child(9) { width: 120px !important; }
|
| 208 |
|
| 209 |
-
/* #10 user_id
|
| 210 |
-
#booking_table th:nth-child(10), #booking_table td:nth-child(10) { width: 320px !important; }
|
| 211 |
"""
|
| 212 |
|
| 213 |
# --- 介面開始 ---
|
|
|
|
| 131 |
error_msg: "<span style='color: red'>❌ 帳號或密碼錯誤</span>"
|
| 132 |
}
|
| 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;
|
|
|
|
| 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;
|
|
|
|
| 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 |
|
| 210 |
# --- 介面開始 ---
|