| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<meta charset="utf-8"> |
| 5 |
<title>jQuery tablesorter 2.0 - Built-in parsers</title> |
| 6 |
|
| 7 |
|
| 8 |
<script src="js/jquery-latest.min.js"></script> |
| 9 |
|
| 10 |
|
| 11 |
<link href="css/jq.css" rel="stylesheet"> |
| 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 |
<style>th, tr td:nth-child(8) { text-align:center; } td img { width:20px; }</style> |
| 21 |
|
| 22 |
<script id="js">$(function() { |
| 23 |
// call the tablesorter plugin |
| 24 |
$("table").tablesorter({ |
| 25 |
theme : 'blue', |
| 26 |
imgAttr: 'title' // image attribute used by "image" parser |
| 27 |
}); |
| 28 |
});</script> |
| 29 |
</head> |
| 30 |
<body> |
| 31 |
<div id="banner"> |
| 32 |
<h1>table<em>sorter</em></h1> |
| 33 |
<h2>Built-in parsers</h2> |
| 34 |
<h3>Flexible client-side table sorting</h3> |
| 35 |
<a href="index.html">Back to documentation</a> |
| 36 |
</div> |
| 37 |
<div id="main"> |
| 38 |
|
| 39 |
<p class="tip"> |
| 40 |
<em>NOTE!</em> |
| 41 |
</p> |
| 42 |
<ul> |
| 43 |
<li>This demo is showing all of the built-in parsers (included with tablesorter's core).</li> |
| 44 |
<li><a href="index.html#custom-parsers">Additional parsers</a> are available, but must be loaded after the core.</li> |
| 45 |
<li>Or, you have the option of writing a <a href="example-parsers.html">custom parser</a> by using the <a href="index.html#function-addparser"><code>addParser</code></a> function.</li> |
| 46 |
<li>The built-in <code>metadata</code> parser requires the metadata plugin; maintained for backwards compatibility. An example is not included in this demo.</li> |
| 47 |
</ul> |
| 48 |
|
| 49 |
<h1>Demo</h1> |
| 50 |
<div id="demo"> |
| 51 |
<table class="tablesorter"> |
| 52 |
<thead> |
| 53 |
<tr> |
| 54 |
<th class="sorter-no-parser">"no-parser"<br>will not sort</th> |
| 55 |
<th class="sorter-text">"text"</th> |
| 56 |
<th class="sorter-digit">"digit"</th> |
| 57 |
<th class="sorter-currency">"currency"</th> |
| 58 |
<th class="sorter-url">"url"</th> |
| 59 |
<th class="sorter-isoDate">"isoDate"</th> |
| 60 |
<th class="sorter-percent">"percent"</th> |
| 61 |
<th class="sorter-image">"image"</th> |
| 62 |
<th class="sorter-usLongDate">"usLongDate"</th> |
| 63 |
<th class="sorter-shortDate" data-date-format="mmddyyyy">"shortDate"<br>(mmddyyyy)</th> |
| 64 |
<th class="sorter-shortDate" data-date-format="ddmmyyyy">"shortDate"<br>(ddmmyyyy)</th> |
| 65 |
<th class="sorter-shortDate" data-date-format="yyyymmdd">"shortDate"<br>(yyyymmdd)</th> |
| 66 |
<th class="sorter-time">"time"</th> |
| 67 |
</tr> |
| 68 |
</thead> |
| 69 |
<tbody> |
| 70 |
<tr><td>1</td><td>abc</td><td>02</td><td>$10.00</td><td>https://google.com</td><td>2018-07-26</td><td>9.8%</td><td><img src="img/cat.gif" title="Cat"/></td><td>Jul 6, 2006 8:14 AM</td><td>12-31-2017</td><td>31-12-2017</td><td>2017-12-31</td><td>10:00 PM</td></tr> |
| 71 |
<tr><td>4</td><td>xyz</td><td>04</td><td>$9.99</td><td>https://yahoo.com</td><td>2017-07-24</td><td>9.9%</td><td><img src="img/x.gif" title="X marks the spot"/></td><td>Dec 10, 2002 5:14 AM</td><td>12.11.2017</td><td>11.12.2017</td><td>2017.12.11</td><td>10:23 AM</td></tr> |
| 72 |
<tr><td>2</td><td>def</td><td>03</td><td>$01.99</td><td>https://github.com</td><td>2018-08-24</td><td>10%</td><td><img src="img/fish.gif" title="Fish"/></td><td>Jan 18, 2007 9:12 AM</td><td>12/16/2017</td><td>16/12/2017</td><td>2017/12/16</td><td>10:04 PM</td></tr> |
| 73 |
<tr><td>3</td><td>hij</td><td>01</td><td>$00.99</td><td>https://gitlab.com</td><td>2018-07-28</td><td>1%</td><td><img src="img/octopus.gif" title="Octopus"/></td><td>Jul 6, 2006 8:14 AM</td><td>12-04.2017</td><td>4/12 2017</td><td>2017, 12 4</td><td>9:56 PM</td></tr> |
| 74 |
</tbody> |
| 75 |
</table></div> |
| 76 |
|
| 77 |
<h1>Javascript</h1> |
| 78 |
<div id="javascript"> |
| 79 |
<pre class="prettyprint lang-javascript"></pre> |
| 80 |
</div> |
| 81 |
<h1>Page Header</h1> |
| 82 |
<div> |
| 83 |
<pre class="prettyprint lang-html"> |
| 84 |
<link href="css/theme.blue.css" rel="stylesheet"> |
| 85 |
<script src="js/jquery.tablesorter.js"></script></pre> |
| 86 |
</div> |
| 87 |
<h1>HTML</h1> |
| 88 |
<div id="html"> |
| 89 |
<pre class="prettyprint lang-html"></pre> |
| 90 |
</div> |
| 91 |
|
| 92 |
</div> |
| 93 |
|
| 94 |
</body> |
| 95 |
</html> |