remove extra trs

This commit is contained in:
ville rantanen
2017-06-19 22:55:00 +03:00
parent fdd5f9439a
commit 0190a23642

View File

@@ -183,6 +183,7 @@ function print_results(hitList) {
doc.innerHTML="";
var tbl=document.createElement("table");
var tbody=document.createElement("tbody");
var tr=document.createElement("tr");
tbl.appendChild(tbody);
doc.appendChild(tbl);
var str="";
@@ -195,10 +196,11 @@ function print_results(hitList) {
td.id="td_"+name;
if (narrow_window()) { td.className+=" narrow"; }
if (cat%config.columns==0 || narrow_window()) {
tbody.innerHTML+="<tr>";
tbody.appendChild(tr);
tr=document.createElement("tr");
}
td.innerHTML+=make_head(linkList[c]);
tbody.appendChild(td);
tr.appendChild(td);
cats.push({name:name, count:0});
cat+=1;
} else {
@@ -207,6 +209,7 @@ function print_results(hitList) {
cats[cat-1].count++;
}
}
tbody.appendChild(tr);
for (c=0; c<cats.length; c++) {
if (cats[c].count==0) { document.getElementById("td_"+cats[c].name).className+=" hidden"; }
}