I am dynamically creating a table using JavaScript code below:

```
function CreatTable(data) {

    var tablearea;
    var table;
    var thead;
    var tr;
    var th;

    tablearea = document.getElementById('ShowDataID');
    table = document.createElement('table');
    thead = document.createElement('thead');
    tr = document.createElement('tr');

    for (var i = 0; i < data.length; i++) {
        var headerTxt = document.createTextNode(data[i]);
        th = document.createElement('th');
        th.appendChild(headerTxt);
        tr.appendChild(th);
        thead.appendChild(tr);
    }

    table.appendChild(thead);

    for (var i = 1; i < 4; i++) {
        tr = document.createElement('tr');
        tr.appendChild(document.createElement('td'));
        tr.appendChild(document.createElement('td'));
        tr.appendChild(document.createElement('td'));
        tr.cells[0].appendChild(document.createTextNode('John'));
        tr.cells[1].appendChild(document.createTextNode('McDowell'));
        tr.cells[2].appendChild(document.createTextNode('ddd@gmail.com'));

        table.appendChild(tr);
    }
    tablearea.appendChild(table);
}
</script>

```

When I create table I also need to create checkbox column in the table above.

Any idea how I can implement it using JavaScript?
Or related link?