]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/output/DataTable.java
Another calc fix
[gigi.git] / src / org / cacert / gigi / output / DataTable.java
index 6c36effe9e3cdf7cb0c1a2291086bbaeb5394922..e17714c8ab02569edda2d31af6fc1e2f729554c7 100644 (file)
@@ -16,7 +16,7 @@ public class DataTable implements Outputable {
        }
 
        public void output(PrintWriter out, Language l) {
-               int mesCells = cells.size();
+               float mesCells = cells.size();
                for (Cell c : cells) {
                        if (c.getColSpan() > 1) {
                                mesCells += c.getColSpan();
@@ -24,11 +24,10 @@ public class DataTable implements Outputable {
                }
                out.println("<table align=\"center\" valign=\"middle\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"wrapper\">");
                int cellsRendered = 0;
-               for (int i = 0; i < mesCells / columnCount; i++) {
+               for (int i = 0; i < Math.ceil(mesCells / columnCount) - 1; i++) {
                        out.println("<tr>");
                        for (int j = 0; j < columnCount;) {
-                               Cell current = cells.get(cellsRendered);
-                               cellsRendered++;
+                               Cell current = cells.get(cellsRendered++);
                                j += current.getColSpan();
                                out.println("<td " + current.getHtmlAttribs() + " >");
                                out.print(current.shouldTranslate() ? l.getTranslation(current