-
Notifications
You must be signed in to change notification settings - Fork 3
/
demo.html
107 lines (99 loc) · 2.56 KB
/
demo.html
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
<html>
<head>
<title>jQuery Row Count Plugin demo</title>
<style>
div#container {
width: 950px;
margin: 0 auto;
font-size: 18px;
margin-top: 50px;
}
</style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="jquery.rowcount-1.0.js"></script>
</script>
</head>
<body>
<div id="container">
<b>Example #1:</b></p>
<table id="rowCountTable">
<thead>
<tr>
<th>Names</th>
</tr>
</thead>
<tbody>
<tr>
<td>Daryl</td>
</tr>
<tr>
<td>David</td>
</tr>
<tr>
<td>Davy</td>
</tr>
</tbody>
</table>
<p>
<a href="#" onclick="$('table#rowCountTable').rowCount();return false;">Enable row count on example #1</a></p>
<blockquote>
<p><strong>Code:</strong></p>
<p><em>$("table#rowCountTable").rowCount();</em></p>
</blockquote>
<p>
<b>Example #2:</b></p>
<table id="rowCountTable2">
<thead>
<tr>
<th> </th>
<th class="rowCount"></th>
<th>Names</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" /></td>
<td>5.</td>
<td>Daryl</td>
</tr>
<tr id="row-to-remove">
<td><input type="checkbox" /></td>
<td>6.</td>
<td>David</td>
</tr>
<tr>
<td><input type="checkbox" /></td>
<td>7.</td>
<td>Davy</td>
</tr>
</tbody>
</table>
<p>
<a href="#" onclick="$('tr#row-to-remove').remove();$('table#rowCountTable2').rowCount({startAt:5, column:2});return false;">Remove row on example #2</a></p>
<blockquote>
<p>
<strong>Code:</strong></p>
<p>
<em>$("table#rowCountTable").rowCount({startAt:5, column:2});</em></p>
</blockquote>
<p>
There are only 2 options:</p>
<ul>
<li>
<em>startAt</em> - lets you start the next count at a specific number</li>
<li>
<em>column</em> - lets you display the row count at a specific column</li>
</ul>
<p>
It also creates 2 css classes:</p>
<ul>
<li>
<em>rowCount -</em> for the column headers</li>
<li>
<em>rowNumber - </em>for the cells</li>
</ul>
<p>
Apply as many times on an existing table to have it recount the rows - as shown on example #2
</p>
</div>
</body>