title: html dom dynamic table in Internet Explorer
body: <p>Hi i'm currently practicing HTML DOM and i've written this function to create a dynamic table.</p>
  
  <pre><code>function initScheduleTable() {
      var days = new Array("MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN");
      var table = document.getElementById("schedule");
      var hourPerDay = 24;
      var row, cell;
      var i, j;
  
      // Time headers
      row = table.insertRow(-1);
      cell = row.insertCell(-1);
  
      for(i = 0; i &lt; hourPerDay; ++i) {
          cell = row.insertCell(-1);
          if(i &lt; 10)
              cell.innerHTML = "0" + i;
          else
              cell.innerHTML = i;
      }
  
      for(i = 0; i &lt; days.length; ++i) {
          row = table.insertRow(-1);
          cell = document.createElement("th");
          cell.innerHTML = days[i];
          row.appendChild(cell);
  
          for(j = 0; j &lt; hourPerDay; ++j) {
              cell = row.insertCell(-1);
              cell.innerHTML = "&amp;nbsp;";
          }
      }
  }
  </code></pre>
  
  <p>This works fine for Chrome and Firefox but not IE9. With IE the days are displayed on the rightmost column. I checked the source using IE developer's tool and it shows that <code>&lt;th&gt;</code> is listed at the end of a list of <code>&lt;td&gt;</code>.</p>
  
  <p>Is there anything to be paid attention for IE in this case?</p>