You can also use the insertCell method as originally requested. You just have to change the outerHTML to overwrite the <td>
created by the insertCell method:
var table = document.createElement("TABLE")
var row = table.insertRow(0);
row.insertCell(0).outerHTML = "<th>First</th>"; // rather than innerHTML
To match the example given:
HTML
<table id="table">
<thead>
<tr>
<th>First</th>
</tr>
<thead>
</table>
Javascript
var tr = document.getElementById('table').tHead.children[0];
tr.insertCell(1).outerHTML = "<th>Second</th>" // some browsers require the index parm -- 1