Dynamically creating a table in Javascript
问题 I have got a working table that when the button is pushed, a table is dynamically created by looping through an array and displaying that data in each cell. However the problem arises when I am trying to add a table header for my table, and I'm not sure what I am doing wrong. Here is my current working code: (although doesn't seem to work in JSFiddle?!) And here is the code I am trying to add: (which must be wrong) var thd=document.createElement("thead"); tab.appendChild(thd); var tr=