JSFiddle - React, Tailwind, and code Playground
HTML
<h1>table要素関連API</h1>
<h2>sample</h2>
<div id="Sample"></div>
<h2>link</h2>
<ul>
<li><a href="http://okwave.jp/qa/q8810003.html">appendChildとinnerHTMLを短く 【OKWave】</a></li>
</ul>
JavaScript
(function () {
var doc = document,
table = doc.createElement('table'),
thead = table.createTHead(),
tr = thead.insertRow(),
th = doc.createElement('th'),
ths = ['見出1', '見出2', '見出3'];
th.appendChild(doc.createTextNode('string'));
for (var i = 0, l = ths.length; i < l; ++i) {
th = th.cloneNode(true);
th.firstChild.data = ths[i];
tr.appendChild(th);
}
thead.appendChild(tr);
doc.getElementById('Sample').appendChild(table);
})();