質問するログイン新規登録

質問編集履歴

1

コードの修正

2017/04/18 02:43

投稿

hide09090909
hide09090909

スコア68

title CHANGED
File without changes
body CHANGED
@@ -13,29 +13,52 @@
13
13
 
14
14
  HTMLのtable部分
15
15
  ```ここに言語を入力
16
- <table
17
- class="sample"
18
- style="margin-top: 50px">
16
+ <table class="sample" style="margin-top: 50px">
19
- <thead>
17
+ <thead>
20
- <tr>
18
+ <tr>
21
- <th></th>
19
+ <th></th>
22
- <th>タイトル</th>
20
+ <th>タイトル</th>
23
- <th>日時</th>
21
+ <th>日時</th>
24
- </tr>
22
+ </tr>
25
- </thead>
23
+ </thead>
26
- <tbody>
24
+ <tbody>
27
- <tr>
25
+ <tr>
28
- <td><input type="radio" name="check" value="check"></td>
29
- <td></td>
26
+ <td>a</td>
30
- <td></td>
27
+ <td>b</td>
31
- </tr>
28
+ </tr>
29
+
30
+ </tbody>
31
+ </table>
32
+
33
+ <table class="sample" style="margin-top: 50px">
34
+ <thead>
32
- <tr>
35
+ <tr>
33
- <td><input type="radio" name="check" value="check"></td>
34
- <td></td>
36
+ <th></th>
37
+ <th>タイトル</th>
35
- <td></td>
38
+ <th>日時</th>
36
- </tr>
39
+ </tr>
40
+ </thead>
41
+ <tbody id="tbody">
42
+
37
- </tbody>
43
+ </tbody>
38
- </table>
44
+ </table>
45
+
46
+
47
+
48
+
49
+ <script
50
+ src="C:\Json_table表示用\mnt\field\remote\aaaaa\config\instance_def.json">
51
+ //与えられたタグ名を持つ要素のリストを返す。
52
+ var trs = document.getElementsByTagId('tbody');
53
+
54
+ for (var i = 0, length = JSON_DATA.length; i < length; i++) {
55
+ var data = JSON_DATA[i], tr = trs[i], tds = tr
56
+ .getElementsByTagName('td');
57
+
58
+ td[1].innerText = data.file_name;
59
+ td[2].innerText = data.update_name;
60
+ }
61
+ </script>
39
62
  ```
40
63
 
41
64
  Json