I guess it's a div :
var HeaderDivObj= document.getElementById('#yourdivid');
And then you are trying to create a table inside this div :
var HeadertableObj = HeaderDivObj.appendChild(document.createElement('table'));
Now What is appendchild?
The appendChild() method appends a node as the last child of a node.
Refer :
http://www.w3schools.com/jsref/met_node_appendchild.asp[
^]
Good luck