回答編集履歴

1

chousei

2019/05/27 04:44

投稿

yambejp
yambejp

スコア114960

test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  var num=[].map.call(document.querySelectorAll('#t1 thead th'),function(x){
18
18
 
19
- return parseInt(x.textContent);
19
+ return parseInt(x.textContent)||"";
20
20
 
21
21
  });
22
22
 
@@ -25,6 +25,8 @@
25
25
  x.addEventListener("input",function(){
26
26
 
27
27
  [].forEach.call(document.querySelectorAll('#t1 tbody td'),function(x,y){
28
+
29
+ if(num[y]=="") return;
28
30
 
29
31
  var v=0
30
32
 
@@ -56,6 +58,8 @@
56
58
 
57
59
  <tr>
58
60
 
61
+ <th>&nbsp;</th>
62
+
59
63
  <th>10</th>
60
64
 
61
65
  <th>20</th>
@@ -84,6 +88,8 @@
84
88
 
85
89
  <tr>
86
90
 
91
+ <td>合計金額</td>
92
+
87
93
  <td>0</td>
88
94
 
89
95
  <td>0</td>