]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/output/DataTable.java
Less concat
[gigi.git] / src / org / cacert / gigi / output / DataTable.java
index 771a0c2a82a9f06aace35d0d1820d61a51d491da..0a30180070b13e0f27bdb309101abda4f828063f 100644 (file)
@@ -15,9 +15,8 @@ public class DataTable implements Outputable {
                this.cells = content;
        }
 
-       @Override
-       public void output(PrintWriter out, Language l, Map<String, Object> vars) {
-               int mesCells = cells.size();
+       public void output(PrintWriter out, Language l) {
+               float mesCells = cells.size();
                for (Cell c : cells) {
                        if (c.getColSpan() > 1) {
                                mesCells += c.getColSpan();
@@ -25,13 +24,14 @@ 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.println("<td ");
+                               out.print(current.getHtmlAttribs());
+                               out.print(" >");
                                out.print(current.shouldTranslate() ? l.getTranslation(current
                                                .getText()) : current.getText());
                                out.print("</td>");
@@ -87,4 +87,9 @@ public class DataTable implements Outputable {
 
        }
 
+       @Override
+       public void output(PrintWriter out, Language l, Map<String, Object> vars) {
+               output(out, l);
+       }
+
 }