| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<meta charset="utf-8"> |
| 5 |
<title>jQuery tablesorter 2.0 - Set an initial sort order direction</title> |
| 6 |
|
| 7 |
|
| 8 |
<script src="js/jquery-latest.min.js"></script> |
| 9 |
|
| 10 |
|
| 11 |
<link rel="stylesheet" href="css/jq.css"> |
| 12 |
<link href="css/prettify.css" rel="stylesheet"> |
| 13 |
<script src="js/prettify.js"></script> |
| 14 |
<script src="js/docs.js"></script> |
| 15 |
|
| 16 |
|
| 17 |
<link rel="stylesheet" href="../css/theme.blue.css"> |
| 18 |
<script src="../js/jquery.tablesorter.js"></script> |
| 19 |
|
| 20 |
<script id="js">$(function() { |
| 21 |
|
| 22 |
// call the tablesorter plugin |
| 23 |
$("table").tablesorter({ |
| 24 |
theme : 'blue', |
| 25 |
|
| 26 |
// change the default sorting order from 'asc' to 'desc' |
| 27 |
sortInitialOrder: "desc" |
| 28 |
}); |
| 29 |
|
| 30 |
}); </script> |
| 31 |
</head> |
| 32 |
<body> |
| 33 |
<div id="banner"> |
| 34 |
<h1>table<em>sorter</em></h1> |
| 35 |
<h2>Set an initial sorting order direction</h2> |
| 36 |
<h3>Flexible client-side table sorting</h3> |
| 37 |
<a href="index.html">Back to documentation</a> |
| 38 |
</div> |
| 39 |
<div id="main"> |
| 40 |
<h1>Demo</h1> |
| 41 |
<div id="demo"><table class="tablesorter"> |
| 42 |
<thead> |
| 43 |
<tr> |
| 44 |
<th>First Name</th> |
| 45 |
<th>Last Name</th> |
| 46 |
<th>Age</th> |
| 47 |
<th>Total</th> |
| 48 |
<th>Discount</th> |
| 49 |
<th>Date</th> |
| 50 |
</tr> |
| 51 |
</thead> |
| 52 |
<tbody> |
| 53 |
<tr> |
| 54 |
<td>Peter</td> |
| 55 |
<td>Parker</td> |
| 56 |
<td>28</td> |
| 57 |
<td>$9.99</td> |
| 58 |
<td>20%</td> |
| 59 |
<td>Jul 6, 2006 8:14 AM</td> |
| 60 |
</tr> |
| 61 |
<tr> |
| 62 |
<td>John</td> |
| 63 |
<td>Hood</td> |
| 64 |
<td>33</td> |
| 65 |
<td>$19.99</td> |
| 66 |
<td>25%</td> |
| 67 |
<td>Dec 10, 2002 5:14 AM</td> |
| 68 |
</tr> |
| 69 |
<tr> |
| 70 |
<td>Clark</td> |
| 71 |
<td>Kent</td> |
| 72 |
<td>18</td> |
| 73 |
<td>$15.89</td> |
| 74 |
<td>44%</td> |
| 75 |
<td>Jan 12, 2003 11:14 AM</td> |
| 76 |
</tr> |
| 77 |
<tr> |
| 78 |
<td>Bruce</td> |
| 79 |
<td>Almighty</td> |
| 80 |
<td>45</td> |
| 81 |
<td>$153.19</td> |
| 82 |
<td>44%</td> |
| 83 |
<td>Jan 18, 2001 9:12 AM</td> |
| 84 |
</tr> |
| 85 |
<tr> |
| 86 |
<td>Bruce</td> |
| 87 |
<td>Evans</td> |
| 88 |
<td>22</td> |
| 89 |
<td>$13.19</td> |
| 90 |
<td>11%</td> |
| 91 |
<td>Jan 18, 2007 9:12 AM</td> |
| 92 |
</tr> |
| 93 |
</tbody> |
| 94 |
</table></div> |
| 95 |
<h1>Javascript</h1> |
| 96 |
<div id="javascript"> |
| 97 |
<pre class="prettyprint lang-javascript"></pre> |
| 98 |
</div> |
| 99 |
<h1>HTML</h1> |
| 100 |
<div id="html"> |
| 101 |
<pre class="prettyprint lang-html"></pre> |
| 102 |
</div> |
| 103 |
|
| 104 |
<div class="next-up"> |
| 105 |
<hr /> |
| 106 |
Next up: <a href="example-options-headers.html">Disable sort using headers options ››</a> |
| 107 |
</div> |
| 108 |
|
| 109 |
</div> |
| 110 |
|
| 111 |
</body> |
| 112 |
</html> |