Part of the problem is the HTML. Strictly speaking, you can't put a div into a table like that. You can put a div into a table cell, but you can't put only part of a table (a set of rows, for instance) into a div in a table.
In this case, you are using an ordinary table row as your table header, then trying to dynamically add rows. You can simplify that a whole bunch by using a real table header, then filling in the table body:
<th>Last Name, First Name</th>
“Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
"It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)