If you append it will obviously try to close tags.
Try to put your html in an string than append that string to the dom.
<script>
var ctr = 0;
var html="<tr>";
for (var g in g2u) {
html+='<td><span class="rom">'+g+'</span>\n';
html+='<span class="eh">'+g2u[g]+'</span>\n';
html+='<span class="rom"> </span></td>\n';
ctr++;
if (ctr % 8 == 0) {
html+='</tr><tr>\n';
}
}
$("#list").append(html);