Update app.py
Browse files
app.py
CHANGED
|
@@ -58,14 +58,18 @@ if st.button('Buscar'):
|
|
| 58 |
# Display results if available
|
| 59 |
if st.session_state.results is not None:
|
| 60 |
df = st.session_state.results
|
| 61 |
-
rows_to_display =
|
| 62 |
st.table(df.head(rows_to_display))
|
| 63 |
|
| 64 |
col1, col2 = st.columns([1, 1])
|
| 65 |
|
| 66 |
with col1:
|
| 67 |
-
if
|
| 68 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
with col2:
|
| 71 |
csv = df.to_csv(index=False)
|
|
|
|
| 58 |
# Display results if available
|
| 59 |
if st.session_state.results is not None:
|
| 60 |
df = st.session_state.results
|
| 61 |
+
rows_to_display = 20 if not st.session_state.show_all else len(df)
|
| 62 |
st.table(df.head(rows_to_display))
|
| 63 |
|
| 64 |
col1, col2 = st.columns([1, 1])
|
| 65 |
|
| 66 |
with col1:
|
| 67 |
+
if len(df) > 20:
|
| 68 |
+
if st.button('Ver más'):
|
| 69 |
+
st.session_state.show_all = not st.session_state.show_all
|
| 70 |
+
# Reset button text after showing all
|
| 71 |
+
if st.session_state.show_all:
|
| 72 |
+
st.button('Ver menos')
|
| 73 |
|
| 74 |
with col2:
|
| 75 |
csv = df.to_csv(index=False)
|