Is it possible to create a TH with TableRow.insertCell()?
dom, html, html-table, javascript
Solution
I don't see any official docs that allow you to do this.
W3C Documentation for TR / TR.insertCell
The `createElement/appendChild` will work though.
Problem
I'm adding new rows to a table dynamically, with this code: ``` tbody = document.getElementById('tbody'); tr = tbody.insertRow(-1); tr.id = 'last'; th = tr.insertCell(0); td = tr.insertCell(1); ``` But what I actually got are two `td` cells. I want a `th`, as you can see. It says the `tagName` property isn't changeable. How can I do this? Will I need to use 'normal' methods like `createElement` and `appendChild`?