Skip to content

Commit

Permalink
webpage: implement a page indexing system.
Browse files Browse the repository at this point in the history
* Added instructions for termux installation

Added steps to avoid numpy wheel error in termux

* Added page indexing system

User can control number of entries being displayed and also search in it
  • Loading branch information
TheDarkW3b authored Jan 20, 2024
1 parent 1f89dc7 commit 15f346d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def display_df_web(df, heading, subheading):
f"{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.html")

# convert the DataFrame to an HTML table
html_table = df.to_html(index=False, classes='table')
html_table = df.to_html(index=False, classes='table',table_id="tableID")

# Generate the complete HTML content with headings, CSS styles, and the
# table
Expand Down Expand Up @@ -405,12 +405,23 @@ def display_df_web(df, heading, subheading):
}}
</style>
</head>
<script type="text/javascript"
src="https://code.jquery.com/jquery-3.5.1.js">
</script>
<link rel="stylesheet"
href="https://cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css">
<script src="https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js">
</script>
<body>
<h1><a href="https://github.com/ksauraj/jee_counsellor">{heading}</a></h1>
<h2><a href="https://sauraj.eu.org">{subheading}</a></h2>
<div class="container">
{html_table}
</div>
<script>
$(document).ready(function () {{ $('#tableID').DataTable({{ pageLength: 15 }}); }});
</script>
</body>
</html>
'''
Expand Down

0 comments on commit 15f346d

Please sign in to comment.