Update pages/home.py
Browse files- pages/home.py +14 -31
pages/home.py
CHANGED
@@ -49,37 +49,20 @@ st.header("Tags the below 41 medical entities")
|
|
49 |
'WEIGHT'
|
50 |
|
51 |
|
52 |
-
#
|
53 |
-
|
54 |
-
|
55 |
|
56 |
-
#
|
57 |
-
|
58 |
-
|
59 |
-
<html>
|
60 |
-
<head>
|
61 |
-
<style>
|
62 |
-
body {{
|
63 |
-
font-family: sans-serif;
|
64 |
-
padding: 10px;
|
65 |
-
}}
|
66 |
-
</style>
|
67 |
-
</head>
|
68 |
-
<body>
|
69 |
-
{content_html}
|
70 |
-
<script>
|
71 |
-
// Auto-scroll to bottom when loaded
|
72 |
-
window.onload = function() {{
|
73 |
-
window.scrollTo(0, document.body.scrollHeight);
|
74 |
-
}};
|
75 |
-
</script>
|
76 |
-
</body>
|
77 |
-
</html>
|
78 |
-
"""
|
79 |
|
80 |
-
#
|
81 |
-
st.
|
82 |
|
83 |
-
#
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
49 |
'WEIGHT'
|
50 |
|
51 |
|
52 |
+
# This is the key trick:
|
53 |
+
# 1. Define all content first
|
54 |
+
content = [f"This is scrollable content line {i}" for i in range(100)]
|
55 |
|
56 |
+
# 2. Display first part of content
|
57 |
+
for i in range(len(content) - 1):
|
58 |
+
st.write(content[i])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
+
# 3. Add a placeholder for the last item
|
61 |
+
last_item = st.empty()
|
62 |
|
63 |
+
# 4. Show "Bottom Reached!" message to confirm we're at the bottom
|
64 |
+
st.success("Bottom of page reached!")
|
65 |
+
|
66 |
+
# 5. Finally, add the last content item
|
67 |
+
# This forces Streamlit to render the page up to the bottom
|
68 |
+
last_item.write(content[-1])
|