forked from kylefox/jquery-tablesort
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathajax-example.html
More file actions
128 lines (116 loc) · 2.94 KB
/
ajax-example.html
File metadata and controls
128 lines (116 loc) · 2.94 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<html>
<head>
<title></title>
<style type="text/css">
body {
font: normal 14px/21px Arial, serif;
}
.example {
float: left;
width: 40%;
margin: 5%;
}
table {
font-size: 1em;
border-collapse: collapse;
margin: 0 auto
}
table, th, td {
border: 1px solid #999;
padding: 8px 16px;
text-align: left;
}
table.ex-2 {
min-width: 100px;
}
th {
background: #f4f4f4;
cursor: pointer;
}
th:hover,
th.sorted {
background: #d4d4d4;
}
th.no-sort,
th.no-sort:hover {
background: #f4f4f4;
cursor: not-allowed;
}
th.sorted.ascending:after {
content: " \2191";
}
th.sorted.descending:after {
content: " \2193";
}
.disabled {
opacity: 0.5;
}
</style>
</head>
<body>
<div class="example ex-1">
<table>
<thead>
<tr>
<th>Name</th>
<th>Band</th>
<th>Date of Birth</th>
<th class="number">Age</th>
</tr>
</thead>
<tbody>
<tr>
<td>Big</td>
<td>Radiohead</td>
<td data-sort-value="2">October 7, 1968</td>
<td>43</td>
</tr>
<tr>
<td>big</td>
<td>Bon Iver</td>
<td data-sort-value="4">April 30, 1981</td>
<td>30</td>
</tr>
<tr>
<td>aron</td>
<td>The Beatles</td>
<td data-sort-value="1">June 18, 1942</td>
<td>69</td>
</tr>
<tr>
<td>Aron</td>
<td>Iron & Wine</td>
<td data-sort-value="3">July 26, 1974</td>
<td>37</td>
</tr>
<tr>
<td>din</td>
<td>Iron & Wine</td>
<td data-sort-value="3">July 26, 1974</td>
<td>37</td>
</tr>
<tr>
<td>Din</td>
<td>Iron & Wine</td>
<td data-sort-value="3">July 26, 1974</td>
<td>37</td>
</tr>
</tbody>
</table>
<a href="#" id="add">Добавить</a>
</div>
<div class="example ex-2">
<div id="sort-msg" style="float: right;" />
</div>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="jquery.tablesort.js"></script>
<script type="text/javascript">
$(function() {
$('table').tablesort().data('tablesort');
$("#add").click(function(){
$("tbody").append('<tr><td>Sam Beam</td><td>Iron & Wine</td><td data-sort-value="5">July 26, 1974</td><td>37</td><td data-sort-value="15"><img src="http://www.nicenicejpg.com/100" width="50"></td></tr>');
});
});
</script>
</body>
</html>