I am adding new rows to the table dynamically using this code:
tbody = document.getElementById('tbody'); tr = tbody.insertRow(-1); tr.id = 'last'; th = tr.insertCell(0); td = tr.insertCell(1);
But I actually have two td cells. I want th , as you can see.
It states that the tagName property cannot be changed.
How can i do this?
Do I need to use "regular" methods like createElement and appendChild ?
javascript dom html html-table
igorsantos07
source share