1<table id="myTable">
2 <tr>
3 <td>Row1 cell1</td>
4 <td>Row1 cell2</td>
5 </tr>
6 <tr>
7 <td>Row2 cell1</td>
8 <td>Row2 cell2</td>
9 </tr>
10 <tr>
11 <td>Row3 cell1</td>
12 <td>Row3 cell2</td>
13 </tr>
14</table>
15<button type="button" onclick="myFunction()">Try it</button>
16
17<script>
18function myFunction() {
19 var table = document.getElementById("myTable");
20 var row = table.insertRow(0);
21 var cell1 = row.insertCell(0);
22 var cell2 = row.insertCell(1);
23 cell1.innerHTML = "NEW CELL1";
24 cell2.innerHTML = "NEW CELL2";
25}
26</script>
27