Chaplain0908 commited on
Commit
6cd63b4
·
verified ·
1 Parent(s): 3a9d954

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -1
app.py CHANGED
@@ -55,7 +55,7 @@ def df_to_html_table(df, height=400):
55
  bg = '#f5f5f5' if i % 2 == 0 else '#ffffff'
56
  html += f'<tr style="background-color: {bg};">'
57
  for val in row:
58
- html += f'<td style="padding: 4px 14px; text-align: left; border-bottom: 1px solid #eee;">{val}</td>'
59
  html += '</tr>'
60
 
61
  html += '</tbody></table></div>'
@@ -70,6 +70,25 @@ st.set_page_config(
70
  #背景颜色
71
  st.markdown("""
72
  <style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  /* 隐藏顶部深色栏 */
74
  header[data-testid="stHeader"] {
75
  background-color: #ffffff;
 
55
  bg = '#f5f5f5' if i % 2 == 0 else '#ffffff'
56
  html += f'<tr style="background-color: {bg};">'
57
  for val in row:
58
+ html += f'<td style="padding: 4px 14px; text-align: left; border-bottom: 1px solid #eee; color: #333;">{val}</td>'
59
  html += '</tr>'
60
 
61
  html += '</tbody></table></div>'
 
70
  #背景颜色
71
  st.markdown("""
72
  <style>
73
+ /* 强制浅色模式,解决 HF 深色模式问题 */
74
+ :root {
75
+ color-scheme: light only !important;
76
+ }
77
+ html, body, [data-testid="stAppViewContainer"], [data-testid="stMain"] {
78
+ background-color: #ffffff !important;
79
+ color: #333333 !important;
80
+ }
81
+
82
+ /* 移除外层滚动,避免 HF iframe 双层滚动 */
83
+ html, body {
84
+ overflow: hidden !important;
85
+ height: 100% !important;
86
+ }
87
+ [data-testid="stAppViewContainer"] {
88
+ overflow-y: auto !important;
89
+ height: 100vh !important;
90
+ }
91
+
92
  /* 隐藏顶部深色栏 */
93
  header[data-testid="stHeader"] {
94
  background-color: #ffffff;