tx3bas commited on
Commit
d40dfec
·
verified ·
1 Parent(s): 7b701bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
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 = 10 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 st.button('Ver más'):
68
- st.session_state.show_all = not st.session_state.show_all
 
 
 
 
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)