How do I implement paging using an HTML table?
I have an html table that dynamically binds server side data in C #. The problem is that I have a search button that invokes a DB search (in a server side search method) based on information from the client page. this search method loads information from db and updates the html table (this is where the information gets linked dynamically)
for (int i = 0; i < data.Count; i++)
{
FirstCell.Controls.Add(lbl1);
SecondCell.Controls.Add(lbl2);
ThirdCell.Controls.Add(lbl3);
row.Cells.Add(FirstCell);
row.Cells.Add(SecondCell);
row.Cells.Add(ThirdCell);
Table.Rows.Add(row);
}
... and after that I save the loaded objects from the DB in a session variable, for example: Session {"data"] = data;
My question is how to display an html table with a specific number of records per page with page indexes at the bottom of the view page below the table? And as I iterate over these pages, the data is preserved and not lost? I am not trying to use ASP.net controls !!!
source to share
Have you seen this post on How to Implement Client-Side Paging in a Gridview Control Using JQuery ? Here's an example of this activity - Swap Datagrid using JQuery example
This can be changed to work with the html table.
source to share