title: how insert `thead` before inserting the `tbody` with jquery
body: <p>i have made a project to select data from database into a table. i use jquery i just made the code for select the data to the table. but now i have a problem. i dont know how to fill thead before inserting the tbody that can fit with the tbody item.</p>
  
  <p>this my code to select data from database i use jquery </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $.ajax({
      type: "POST",
      url: "../php/absen/spl_inputselect_data.php",
      success: function(data) {
        var list = JSON.parse(data);
        for (var i = 0; i &lt; list.length; i++) {
  
          var tr = "&lt;tr&gt;";
  
          tr += "&lt;td&gt;" + list[i]['no'] + "&lt;/td&gt;";
          tr += "&lt;td&gt;" + list[i]['nama'] + "&lt;/td&gt;";
          tr += "&lt;td&gt;" + list[i]['tanggal'] + "&lt;/td&gt;";
          tr += "&lt;td&gt;" + list[i]['jam_mulai'] + "&lt;/td&gt;";
          tr += "&lt;td&gt;" + list[i]['jam_selesai'] + "&lt;/td&gt;";
          tr += "&lt;td&gt;" + list[i]['status'] + "&lt;/td&gt;";
          tr += "&lt;td&gt;" + list[i]['total'] + "&lt;/td&gt;";
          tr += "&lt;td&gt;" + list[i]['bagian'] + "&lt;/td&gt;";
          tr += "&lt;td&gt;" + list[i]['cost'] + "&lt;/td&gt;";
          tr += "&lt;td&gt;" + list[i]['tugas'] + "&lt;/td&gt;";
          tr += "&lt;/tr&gt;";
          $("#check_data tbody").append(tr);
        }
        return false;
      }
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>