title: How to loop through table td and update
body: <p>I am trying to loop through a table's td and update each td based on an array:</p>
  
  <pre><code>var person = []; //each array stores a person's name, height, and weight
  
  for (i = 0; i &lt; 5; i++) {
  
    $("table th").each(function(){
      $(this).text(person[i].name);
    });
  
    $("table td").each(function() {
      $(this).text(person[i].height + '/' + person[i].weight);
    });
  
  }
  </code></pre>
  
  <p>However, this ends up storing the last value of the array in the td... I need help in looping through the td's based on their index...  can someone help?</p>