title: How to dynamically create a TypeScript table
body: <p>Typescript doesnt seem to accept the standard syntax for creating a javascript table, so what is the appropriate method? I was unable to find documentation concrning tables in TypeScript.</p>
  <p>This is what I would expect to work:</p>
  <pre><code>    var table = document.getElementById(&quot;myTable&quot;);
      var row = table.insertRow(0);
      var cell1 = row.insertCell(0);
      var cell2 = row.insertCell(1);
      cell1.innerHTML = &quot;NEW CELL1&quot;;
      cell2.innerHTML = &quot;NEW CELL2&quot;;
  </code></pre>
  <p>That is a direct paste from W3schools javascript, however visual studio reports an error at table.insertRow();</p>
  <p>&quot;Property 'insertRow' does not exist on type 'HTMLElement'&quot;</p>
  <p>The same error occurs using this code:</p>
  <pre><code>class ModuleTable {
    table: HTMLTableElement;
    private thead: HTMLElement;
    private tbody: HTMLElement;
    constructor() {
      this.table = document.createElement('table');
      this.thead = this.table.createTHead();
      this.tbody = this.table.createTBody();
      var row = this.thead.insertRow(0);
      var cell = row.insertCell(0);
      cell.innerHTML = &quot;Module ID&quot;;
     }
  }
  </code></pre>
  <p>Should I use appendChildren with a new HTMLElement, representing a row to be added to the header?</p>