]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/output/DataTable.java
removed debug output
[gigi.git] / src / org / cacert / gigi / output / DataTable.java
index 3f131a224c05ea3df8fe33014c8842c64cf4031e..fb4f4da6f3baab60d1ed319c63deb886c5bf34da 100644 (file)
@@ -15,8 +15,7 @@ public class DataTable implements Outputable {
                this.cells = content;
        }
 
-       @Override
-       public void output(PrintWriter out, Language l, Map<String, Object> vars) {
+       public void output(PrintWriter out, Language l) {
                int mesCells = cells.size();
                for (Cell c : cells) {
                        if (c.getColSpan() > 1) {
@@ -24,10 +23,11 @@ public class DataTable implements Outputable {
                        }
                }
                out.println("<table align=\"center\" valign=\"middle\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"wrapper\">");
-               for (int i = 0; i < mesCells / columnCount; i++) {
+               int cellsRendered = 0;
+               for (int i = 0; i < (mesCells / columnCount) - 1; i++) {
                        out.println("<tr>");
                        for (int j = 0; j < columnCount;) {
-                               Cell current = cells.get((i * columnCount) + j);
+                               Cell current = cells.get(cellsRendered++);
                                j += current.getColSpan();
                                out.println("<td " + current.getHtmlAttribs() + " >");
                                out.print(current.shouldTranslate() ? l.getTranslation(current
@@ -53,6 +53,9 @@ public class DataTable implements Outputable {
                        this.text = text;
                        this.translate = translate;
                        this.htmlAttribs = htmlAttribs;
+                       if (colSpan > 1) {
+                               this.htmlAttribs += " colspan=\"" + colSpan + "\"";
+                       }
                        this.colSpan = colSpan;
                }
 
@@ -82,4 +85,9 @@ public class DataTable implements Outputable {
 
        }
 
+       @Override
+       public void output(PrintWriter out, Language l, Map<String, Object> vars) {
+               output(out, l);
+       }
+
 }