Skip to content

Commit

Permalink
bugfix: printing tables didn't work if the table had a label column.
Browse files Browse the repository at this point in the history
  • Loading branch information
haesleinhuepf committed Mar 17, 2021
1 parent ba4e17b commit 9678056
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ private static String tableToHTML(ResultsTable table) {
}

StringBuilder tableBuilder = new StringBuilder();

String[] headings = table.getHeadings();
if (headings.length == 0) {
return "";
Expand All @@ -117,7 +118,11 @@ private static String tableToHTML(ResultsTable table) {
tableBuilder.append("<tr>");
for (String header : headings) {
int column = table.getColumnIndex(header);
tableBuilder.append("<td>" + table.getStringValue(column, row) + "</td>");
if (column >= 0) {
tableBuilder.append("<td>" + table.getStringValue(column, row) + "</td>");
} else if (header.compareTo("Label") == 0) { // if column index < 0 it must be the label
tableBuilder.append("<td>" + table.getLabel(row) + "</td>");
}
}
tableBuilder.append("</tr>\n");
}
Expand Down

0 comments on commit 9678056

Please sign in to comment.