How to add table row in javascript or jQuery?

Assume that below is your HTML table. 

<table id="myTable">
     <tbody>
       <tr><td>Col0</td><td>Col0</td></tr>
     </tbody>
</table>

or

<table id="myTable">
</table>

Add row dynamically in javascript as below:

let _table = document.getElementById("myTable");
var _row = _table.insertRow(_table.rows.length);
// Insert New Column for Row at index '0'.
var rowCol1 = _row.insertCell(0);
row1col1.innerHTML = 'Col1';
// Insert New Column for Row at index '1'.
var rowCol2 = _row.insertCell(1);
row1col2.innerHTML = 'Col2';

Add row dynamically in jQuery as below:

$('#myTable').append('<tr><td>Col1</td><td>Col2</td></tr>');

Demo: https://jsbin.com/fejificoqo/1/edit?html,output