title: Rendering HTML table inside <div> using javascript function
body: <p>I'm trying to get my javascript function that creates a html table in my content div on my website. The problem is, that it is not displayed inside the div but under it. How can I put it inside?</p>
  
  <pre><code>&lt;div id="tab-container" class='tab-container'&gt;
      &lt;ul class='etabs'&gt;
          &lt;li class='tab'&gt;&lt;a href="#tabs1-start"&gt;Start&lt;/a&gt;&lt;/li&gt;
          &lt;li class='tab'&gt;&lt;a href="#tabs1-schicht"&gt;Schichtplan&lt;/a&gt;&lt;/li&gt;
          &lt;li class='tab'&gt;&lt;a href="#tabs1-rechnung"&gt;Rechnung&lt;/a&gt;&lt;/li&gt;
          &lt;li class='tab'&gt;&lt;a href="#tabs1-kontakt"&gt;Kontakt&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;div class='panel-container'&gt;
          &lt;div id="tabs1-start"&gt;
              Test page 1
          &lt;/div&gt;
          &lt;div id="tabs1-schicht"&gt;
              &lt;script type"text/javascript"&gt;
                  tableCreate();
              &lt;/script&gt;
          &lt;/div&gt;
          &lt;div id="tabs1-rechnung"&gt;
              Test page3
  
          &lt;/div&gt;
          &lt;div id="tabs1-kontakt"&gt;
              Test page4
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is my basic website with the navigationbar. When I run it with xampp the js function tableCreate(); is displayed after the panel-container div closes.</p>
  
  <p>Here is my js code:</p>
  
  <pre><code>function tableCreate(){
  //var schicht=["datum","schicht","schicht","schicht","dispo","schicht","schicht","schicht","schicht","schicht","schicht","dispo"];
  var body=document.getElementsByTagName('body')[0];
  var tbl=document.createElement('table');
  tbl.style.width='100%';
  tbl.setAttribute('border','1');
  var tbdy=document.createElement('tbody');
  for(var i=0;i&lt;28;i++){
      var tr=document.createElement('tr');
      for(var j=0;j&lt;12;j++){
          if(i==27 &amp;&amp; j==12){
                  break   
                   } else {
          var td=document.createElement('td');
          td.appendChild(document.createTextNode('schicht'))
          tr.appendChild(td)
          }
      }
      tbdy.appendChild(tr);
  }
  tbl.appendChild(tbdy);
  body.appendChild(tbl)
  </code></pre>
  
  <p>Thanks in advance.</p>