File tree 2 files changed +24
-8
lines changed 2 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 8
8
</ head >
9
9
< body >
10
10
< div class ="content-tab ">
11
- < table >
11
+ < table id =" tab " >
12
12
< thead >
13
13
< tr >
14
14
< td > A</ td >
19
19
</ tr >
20
20
</ thead >
21
21
< tbody >
22
- < tr >
23
- < td > 1</ td >
24
- < td > X</ td >
25
- < td > 0</ td >
26
- < td > =</ td >
27
- < td > 0</ td >
28
- </ tr >
22
+
29
23
</ tbody >
30
24
< tfoot >
31
25
32
26
</ tfoot >
33
27
</ table >
34
28
</ div >
29
+ < script src ="./js/script.js " type ="text/javascript "> </ script >
35
30
</ body >
36
31
</ html >
Original file line number Diff line number Diff line change
1
+ let tab = document . querySelector ( '#tab tbody' )
2
+ let valueA = 5
3
+ tab . innerHTML = ''
4
+
5
+ for ( let valueB = 0 ; valueB <= 10 ; valueB ++ ) {
6
+ let r = valueA * valueB
7
+
8
+ let tpl = `
9
+ <tr>
10
+ <td>${ valueA } </td>
11
+ <td>X</td>
12
+ <td>${ valueB } </td>
13
+ <td>=</td>
14
+ <td>${ r } </td>
15
+ </tr>
16
+ `
17
+
18
+ let tr = document . createElement ( 'tr' )
19
+ tr . innerHTML = tpl
20
+ tab . append ( tr )
21
+ }
You can’t perform that action at this time.
0 commit comments