Sorting HTML Tables using Javascript:
I'm already demonstrated how to use HTML tables on the client for a very simple client-side paging solution.
I've heard from several people who point out the performance problems with large sets of data.
I agree. This solution is best for a fairly fixed amount of data.
In this post I've add the sorting function in that same table so now the sorting and paging available in same table
Here just put a class name "sort" to the table tag
For example:
<table id="tablepaging" class="sap sort" align="center" >
Incase if you want to remove sorting for a particular column in a table
just put a class name "unsort" to the corresponding header tag
For example:
<th> class="unsort">Geometry </th>
Online Demo:
Name ![]() |
Major ![]() |
English ![]() |
Tamil ![]() |
Calculus ![]() |
Geometry |
---|---|---|---|---|---|
Student01 | Languages | 80 | 70 | 75 | 80 |
Student02 | Mathematics | 90 | 88 | 100 | 90 |
Student03 | Languages | 40 | 40 | 35 | 60 |
Student04 | Mathematics | 50 | 68 | 100 | 70 |
Student05 | Languages | 45 | 45 | 65 | 75 |
« Prev 1 2 3 4 5 Next »

0 comments
Post a Comment