satya
Joined: 08 May 2008 Posts: 62
|
Posted: Mon Mar 02, 2009 10:56 am Post subject: Sorting functionality using jquery. |
|
|
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css" media="print, projection, screen" />
****download above Stylesheet file through *****
http://tablesorter.com/themes/blue/style.css
<script type="text/javascript" src="jquery-latest.js"></script>
****download above script file through *****
http://tablesorter.com/jquery-latest.js
<script type="text/javascript" src="jquery.tablesorter"></script>
****download above script file through *****
http://tablesorter.com/jquery.tablesorter.js
<script type="text/javascript">
$(function() {
$("#tablesorter-demo").tablesorter({sortList:[[0,0],[2,1]], widgets: ['zebra']});
$("#options").tablesorter({sortList: [[0,0]], headers: { 3:{sorter: false}, 4:{sorter: false}}});
});
</script>
</head>
<body>
<div id="main">
<table id="tablesorter-demo" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Age</th>
</tr>
</thead>
<tbody>
<tr>
<td>Test1</td>
<td>Sample1</td>
<td>28</td>
</tr>
<tr>
<td>Test2</td>
<td>Sample2</td>
<td>33</td>
</tr>
<tr>
<td>Test3</td>
<td>Sample3</td>
<td>18</td>
</tr>
<tr>
<td>Test4</td>
<td>Sample4</td>
<td>45</td>
</tr>
<tr>
<td>Test5</td>
<td>Sample5</td>
<td>22</td>
</tr>
</tbody>
</table>
</div>
</body>
</html> |
|