-
Notifications
You must be signed in to change notification settings - Fork 1
/
tMove.html
executable file
·46 lines (44 loc) · 1.26 KB
/
tMove.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
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css/datatable.css" rel="stylesheet" type="text/css" />
<script src="js/jquery/jquery.js" type="text/javascript"></script>
<script src="js/jquery/jquery.dataTables.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
dTable = $('#dTest').dataTable();
$('#addBtn').click(function () {
dTable.fnAddData(["rowx col1", "rowx col2"]);
});
$('#deleteBtn').click(function () {
dTable.fnDeleteRow(0, null, true);
});
});
</script>
</head>
<body>
<button id="deleteBtn">1. Delete First Row</button>
<br/>
<br/>
<button id="addBtn">2. Add Row</button>
<br/>
<br/>
<table id="dTest">
<thead>
<tr>
<th>Col1</th>
<th>Col2</th>
</tr>
</thead>
<tbody>
<tr>
<td>row1 col1</td>
<td>row1 col2</td>
</tr>
<tr>
<td>row2 col1</td>
<td>row2 col2</td>
</tr>
</tbody>
</table>
</body>
</html>