回答編集履歴
1
結果を表に
test
CHANGED
@@ -18,12 +18,18 @@
|
|
18
18
|
|
19
19
|
body.edit section:not(.edit),
|
20
20
|
|
21
|
-
body.question section:not(.question)
|
21
|
+
body.question section:not(.question),
|
22
|
+
|
23
|
+
body.result section:not(.result)
|
24
|
+
|
25
|
+
{
|
22
26
|
|
23
27
|
display: none;
|
24
28
|
|
25
29
|
}
|
26
30
|
|
31
|
+
th { width: 5em; }
|
32
|
+
|
27
33
|
</style>
|
28
34
|
|
29
35
|
|
@@ -122,6 +128,20 @@
|
|
122
128
|
|
123
129
|
|
124
130
|
|
131
|
+
<section class="result">
|
132
|
+
|
133
|
+
<h4>結果</h4>
|
134
|
+
|
135
|
+
<table border="1">
|
136
|
+
|
137
|
+
<thead><tr><th>a <th>b <th>c <th>d
|
138
|
+
|
139
|
+
<tbody id="TB"></tbody>
|
140
|
+
|
141
|
+
</table>
|
142
|
+
|
143
|
+
<section>
|
144
|
+
|
125
145
|
|
126
146
|
|
127
147
|
<script>
|
@@ -222,9 +242,19 @@
|
|
222
242
|
|
223
243
|
|
224
244
|
|
245
|
+
document.body.className = 'result';
|
246
|
+
|
247
|
+
ary2tbody (rst2, TB);
|
248
|
+
|
225
249
|
console.log(rst);
|
226
250
|
|
251
|
+
}
|
252
|
+
|
253
|
+
|
254
|
+
|
227
|
-
|
255
|
+
function ary2tbody (ary, tb = document.createElement('tbody')) {
|
256
|
+
|
257
|
+
return ary.reduce((tb, a)=>(a.reduce((tr, str)=>(tr.insertCell().textContent = str, tr),tb.insertRow()), tb), tb);
|
228
258
|
|
229
259
|
}
|
230
260
|
|