title: Runtime creation of tables in Javascript?
body: <p>I my application "When a button is clicked it should create a new text field in the table". So i have done like this and its not working as well. So what could be the problem in the following snippet.</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;script type="text/javascript" language="javascript"&gt;
      var newtr=document.createElement("tr");
      var newtd=document.createElement("td"); 
      var output="&lt;input type=\"textfield\"";
      newtd.innerHtml=output;
      newtr.appendChild(newtd);
      function create_row()
      {
          document.getElementById("table1").appendChild(newtr);
      }
  &lt;/script&gt;
  
  
  &lt;body&gt;
      &lt;table id="table1"&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input type-"textfield" name="tfield"&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt; &lt;input type="button" name="button" value="new row" onclick="create_row();"&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I am using IE7.</p>