title: how to generate dynamic table
body: <p>I have data with me , which is one dropdown data and one from textbox values which i generate dynamic and get the values.
  now i want to generate the table from these value. I get values in alert but I struggling to generate the table</p>
  
  <p>here is my code:</p>
  
  <pre><code>$('#save_skills').on("click",function(){
      $('.importance option:selected').each(function(){
          importance = $(this).text();
      })
      $('input.skill ').each(function() {
          skill =  $(this).val();
          alert(skill);
      });
      $('#div_skills').append('&lt;table class="table table-bordered"&gt;&lt;tr&gt;&lt;td&gt;'+ skill +'&lt;/td&gt;&lt;td&gt;'+ importance +'&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;') 
  });
  </code></pre>
  
  <p>I tried this but i get only last record, how to use for loop for below code, I am confused:</p>
  
  <pre><code>$('#div_skills').append('&lt;table class="table table-bordered"&gt;&lt;tr&gt;&lt;td&gt;'+ skill +'&lt;/td&gt;&lt;td&gt;'+ importance +'&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;')
  </code></pre>
  
  <p>i generate this html dynamically:</p>
  
  <pre><code>$("#addSkills_link").on("click", function () {
  
            $("#table_skills").
  
                  append('&lt;tr&gt;&lt;td&gt;&lt;input type="text" class="form-control skill" id="new_skill" placeholder="Skills"&gt;&lt;/td&gt;&lt;td&gt;&lt;select class="form-control importance" id="ddl_skills"&gt;&lt;option value=""&gt;Select importance&lt;/option&gt;&lt;option value=""&gt;1&lt;/option&gt;&lt;option value=""&gt;2&lt;/option&gt;&lt;option value=""&gt;3&lt;/option&gt;&lt;option value=""&gt;4&lt;/option&gt;&lt;option value=""&gt;5&lt;/option&gt;&lt;option value=""&gt;6&lt;/option&gt;&lt;option value=""&gt;7&lt;/option&gt;&lt;option value=""&gt;8&lt;/option&gt;&lt;option value=""&gt;9&lt;/option&gt;&lt;option value=""&gt;10&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;');
        });
  </code></pre>