File: example-multiple-tbodies.html

package info (click to toggle)
jquery-tablesorter 1%3A2.31.3%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,056 kB
  • sloc: javascript: 19,495; sh: 14; makefile: 8
file content (108 lines) | stat: -rw-r--r-- 3,144 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>jQuery tablesorter 2.0 - Sorting with Multiple Tbodies</title>

	<!-- jQuery -->
	<script src="js/jquery-latest.min.js"></script>

	<!-- Demo stuff -->
	<link rel="stylesheet" href="css/jq.css">
	<link href="css/prettify.css" rel="stylesheet">
	<script src="js/prettify.js"></script>
	<script src="js/docs.js"></script>

	<!-- Tablesorter: required -->
	<link rel="stylesheet" href="../css/theme.blue.css">
	<script src="../js/jquery.tablesorter.js"></script>

	<!-- Tablesorter: widgets (optional) -->
	<script src="../js/jquery.tablesorter.widgets.js"></script>

	<script id="js">$(function() {

	$("table").tablesorter({
		theme : 'blue',
		cssInfoBlock : "tablesorter-no-sort",
		widgets: [ 'zebra', 'stickyHeaders' ]
	});

});</script>
</head>
<body>
<div id="banner">
	<h1>table<em>sorter</em></h1>
	<h2>Sorting with Multiple Tbodies</h2>
	<h3>Flexible client-side table sorting</h3>
	<a href="index.html">Back to documentation</a>
</div>
<div id="main">
<h1>Demo</h1>
<div id="demo"><table class="sortable">
	<thead>
		<tr><th>Name</th><th>A-head</th><th>B-head</th><th>C-head</th></tr>
	</thead>
	<tfoot>
		<tr><th>Name</th><th>A-foot</th><th>B-foot</th><th>C-foot</th></tr>
	</tfoot>

	<!-- add "tablesorter-no-sort" class (changed by cssInfoBlock option) to skip sorting of this tbody -->
	<tbody class="tablesorter-no-sort">
		<tr><th colspan="4">This row is within the first tbody set as an info block - it is not sorted!</th></tr>
	</tbody>

	<tbody>
		<tr><td>DDD</td><td>r1c1</td><td>r1c2</td><td>r1c3</td></tr>
		<tr><td>AAA</td><td>r2c1</td><td>r2c2</td><td>r2c3</td></tr>
		<tr><td>CCC</td><td>r3c1</td><td>r3c2</td><td>r3c3</td></tr>
		<tr><td>BBB</td><td>r4c1</td><td>r4c2</td><td>r4c3</td></tr>
	</tbody>

	<tbody class="tablesorter-no-sort">
		<tr><th colspan="4">summary info for the first group</th></tr>
		<tr><th colspan="4">Another row referring to the first group</th></tr>
	</tbody>

	<tbody>
		<tr><td>Zorro</td><td>r5c1</td><td>r5c2</td><td>r5c3</td></tr>
		<tr><td>Caleb</td><td>r6c1</td><td>r6c2</td><td>r6c3</td></tr>
		<tr><td>Momo</td><td>r7c1</td><td>r7c2</td><td>r7c3</td></tr>
		<tr><td>Wolfie</td><td>r8c1</td><td>r8c2</td><td>r8c3</td></tr>
	</tbody>

	<tbody class="tablesorter-no-sort">
		<tr><th colspan="4">summary info for the second group</th></tr>
	</tbody>

	<tbody>
		<tr><td>Ulysses</td><td>r9c1</td><td>r9c2</td><td>r9c3</td></tr>
		<tr><td>Penelope</td><td>r10c1</td><td>r10c2</td><td>r10c3</td></tr>
		<tr><td>Edvald</td><td>r11c1</td><td>r11c2</td><td>r11c3</td></tr>
		<tr><td>Jan</td><td>r12c1</td><td>r12c2</td><td>r12c3</td></tr>
	</tbody>

	<tbody class="tablesorter-no-sort">
		<tr><th colspan="4">summary info for the last group</th></tr>
	</tbody>

</table></div>

	<h1>Javascript</h1>
	<div id="javascript">
		<pre class="prettyprint lang-javascript"></pre>
	</div>
	<h1>HTML</h1>
	<div id="html">
		<pre class="prettyprint lang-html"></pre>
	</div>

<div class="next-up">
	<hr />
	Next up: <a href="example-header-column-span.html">Sorting Across Multiple Columns &rsaquo;&rsaquo;</a>
</div>

</div>

</body>
</html>