title: Creating simple table in javascript
body: <p>I'm just trying to create simple javascript function that outputs a small table but can't seem to get it working.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;meta charset ="utf-8"&gt;
      &lt;title&gt;Test Table&lt;/title&gt;
      &lt;script type = text/javascript&gt;
  
          function drawTable()
          {
              var tableDiv = document.getElementById( "numbersTable" );
  
              tableDiv.innerHTML = "&lt;table&gt;" + 
              "&lt;caption&gt;Numbers Table&lt;/caption&gt;" +
              "&lt;thead&gt;&lt;th&gt;Number&lt;/th&gt;&lt;th&gt;Square&lt;/th&gt;&lt;th&gt;Cube&lt;/th&gt;&lt;/thead&gt;" +
              "&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;/tr&gt;" +
              "&lt;/tbody&gt;&lt;/table&gt;";
          }
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id = "numbersTable"&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Can anyone see where the problem is?</p>