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
You can do it with vanilla JavaScript. Try this:
HTML
First
JavaScript
var tr = document.getElementById('table').tHead.children[0], th = document.createElement('th'); th.innerHTML = "Second"; tr.appendChild(th);
Here is an example http://codepen.io/anon/pen/Bgwuf