title: Creating a table structure using JQuery
body: <p>In my application, there is a view page to show the table of Attributes name as the header and its value filled by many people below.
  Like</p>
  
  <pre><code>Name Age salary
    a   22  18912
    b   23   89972
    c   23    781273
  </code></pre>
  
  <p>i want it like above ..<br>
  But i am getting it as </p>
  
  <pre><code>Name Age Salary
   a   22  18912  b 23 89972 23 781273
  </code></pre>
  
  <p>I am using JQuery to retrieve these values from my Mysql table and from my Cakephp controller code to view it ..</p>
  
  <pre><code>&lt;head&gt;
    &lt;script type="text/javascript"&gt;
      $(document).ready(function(){
        var ht = $.ajax({
          type: "GET",
          url: "http://localhost/FormBuilder/index.php/admins/viewEntries/"+formid,
          async: false
        }).responseText;
        var myObject = eval('(' + ht + ')');
        var data = myObject;var last;
        $.map(data.labels, function(i){
          last=i.label;
          $("&lt;th&gt;"+i.label+"&lt;/th&gt; ").appendTo("#headers");
        return i.label;});
  
        var htm = $.ajax({
          type: "GET",
          url: "http://localhost/FormBuilder/index.php/admins/viewResults/"+formid,
          async: false
        }).responseText;
        var myObject1 = eval('(' + htm + ')');
        var data1 = myObject1;
        $.map(data1.values, function(i){
          $("&lt;td&gt;"+i.value+"&lt;/td&gt; ").appendTo("#body");
          if(last==i.label){
            // where i thought to create a new row for 2 row
          }
        return i.value;});
      });
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;/body&gt;
    &lt;table class="entries" cellspacing="0" cellpadding="3" border="1"&gt;
      &lt;tr id="headers"&gt;&lt;/tr&gt;
      &lt;tr id="body"&gt;&lt;/tr&gt;
    &lt;/table&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>How to make a new row to display the 2nd and 3rd row values in the new row..Please suggest me.....</p>