I am trying to loop through a table's td and update each td based on an array:
var person = []; //each array stores a person's name, height, and weight
for (i = 0; i < 5; i++) {
$("table th").each(function(){
$(this).text(person[i].name);
});
$("table td").each(function() {
$(this).text(person[i].height + '/' + person[i].weight);
});
}
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?