Today in the study of Bootstrap, suddenly saw Tablesorter this east, immediately Baidu a bit, found this stuff.
Use jquery's Tablesorter plugin for table sorting
So here's what I saw in the project today. Sort of tables used by predecessors
Tablesorter's official website: http://tablesorter.com/docs/
How to use: 1. Download Tablesorter http://tablesorter.com/jquery.tablesorter.zip
2. Unzip the file and import jquery and jquery.tablesorter.min.js into the project file
3. Modify the HTML:
1). Add Link
<script type= "Text/javascript" src= '/pagemedia/js/jquery.tablesorter.min.js ' ></script>
<script type= "Text/javascript" src= '/pagemedia/js/jquery.min.js ' ></script>
2). Modify the table
<table id= "myTable" class= ' Tablesorter ' > Add ID and class,class for table Tablesorter.
(Note: Table must have thead and tbody)
3). Add JavaScript Script:
<script>
$ (document). Ready (function () {$ ("#myTable"). Tablesorter (); });
</script>
The above sentence is most of the online writing, I found in the project writing is this: