paopaoka3325 commited on
Commit
98f951a
·
1 Parent(s): 7b6e922

Add application files

Browse files
Files changed (1) hide show
  1. app.py +4 -13
app.py CHANGED
@@ -81,15 +81,6 @@ def greet(name1, name2):
81
  df_pred.to_csv(temp_file.name, index=False)
82
  csv_output = temp_file.name
83
 
84
- # Add CSS to hide rows beyond the 15th row initially
85
- initial_css = """
86
- <style>
87
- #output-table tr:nth-child(n+16) {
88
- display: none;
89
- }
90
- </style>
91
- """
92
-
93
  # Create a button to toggle table view and a script to handle the button click
94
  show_more_button = """
95
  <button onclick="toggleTableView()">Show More</button>
@@ -111,11 +102,11 @@ def greet(name1, name2):
111
  </script>
112
  """
113
 
114
- # Combine the HTML table, the initial CSS, and the Show More button
115
- html_output = initial_css + html_output + show_more_button
116
-
117
-
118
 
 
 
119
  return html_output, csv_output
120
  # return df_pred.to_html()
121
 
 
81
  df_pred.to_csv(temp_file.name, index=False)
82
  csv_output = temp_file.name
83
 
 
 
 
 
 
 
 
 
 
84
  # Create a button to toggle table view and a script to handle the button click
85
  show_more_button = """
86
  <button onclick="toggleTableView()">Show More</button>
 
102
  </script>
103
  """
104
 
105
+ # Add an id to the HTML table for reference in the JavaScript function
106
+ html_output = html_output.replace("<table ", "<table id='output-table' ")
 
 
107
 
108
+ # Combine the HTML table and the Show More button
109
+ html_output += show_more_button
110
  return html_output, csv_output
111
  # return df_pred.to_html()
112