-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadTable.html
More file actions
63 lines (55 loc) · 1.39 KB
/
readTable.html
File metadata and controls
63 lines (55 loc) · 1.39 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
<!DOCTYPE html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<style>
table {
border-collapse: collapse;
}
td {
border: 1px black solid;
background-color: yellow;
}
</style>
</head>
<body>
<table id="this-table">
<tr id="r0">
<td id="r0c0" class="r0 c0">11</td>
<td id="r0c1" class="r0 c1">21 a</td>
<td id="r0c2" class="r0 c2">31</td>
</tr>
<tr id="r1">
<td id="r1c0" class="r1 c0">42</td>
<td id="r1c1" class="r1 c1">52 b</td>
<td id="r1c2" class="r1 c2">62</td>
</tr>
<tr id="r2">
<td id="r2c0" class="r2 c0">73</td>
<td id="r2c1" class="r2 c1">83 c</td>
<td id="r2c2" class="r2 c2">93</td>
</tr>
</table>
<script>
var data = [1,2,3,4,5,6,7,8,9];
var gatherData = [];
var i;
var temp;
// for (i = 0; i < 3; i++ ) {
// $("#r"+i).each(function() {
// temp = $(this).text()
// console.log("this is ", $(this));
// console.log(temp, typeof temp);
// gatherData.push($(this).text());
// });
// };
function getTableData(inTable, numRow, numCol) {
for (i = 0; i < numRow; i++ ) {
for (j = 0; j < numCol; j++) {
// temp = $("#r"+i+"c"+j).text();
// console.log(temp);
gatherData.push($("#r"+i+"c"+j).text());
}
};}
console.log(gatherData)
</script>
</body>