I want to insert a th tag inside tr of thead element of a table. I am using insertCell method of row object created under
th
tr
thead
insertCell
Use table.tHead.children[0].appendChild(document.createElement("th")) method instead. Basically you have to create a th at runtime and insert it into your thead.
table.tHead.children[0].appendChild(document.createElement("th"))