}
}
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++) {
out.println("<tr>");
for (int j = 0; j < columnCount;) {
- Cell current = cells.get((i * columnCount) + j);
+ Cell current = cells.get(cellsRendered);
+ cellsRendered++;
j += current.getColSpan();
- out.println("<td " + current.getHtmlAttribs()
- + " class=\"DataTD\">");
+ out.println("<td " + current.getHtmlAttribs() + " >");
out.print(current.shouldTranslate() ? l.getTranslation(current
.getText()) : current.getText());
out.print("</td>");
out.println("</table>");
}
- /**
- * <b>Note:</b> All cells have the html attribute class="DataTD"!
- *
- * @author janis
- *
- */
public static class Cell {
private String text, htmlAttribs;
private boolean translate;
this.text = text;
this.translate = translate;
this.htmlAttribs = htmlAttribs;
+ if (colSpan > 1) {
+ this.htmlAttribs += " colspan=\"" + colSpan + "\"";
+ }
this.colSpan = colSpan;
}
public Cell(String text, boolean translate) {
- this(text, translate, 1, "");
+ this(text, translate, 1, "class=\"DataTD\"");
}
public Cell(String text, boolean translate, int colSpan) {
- this(text, translate, colSpan, "");
+ this(text, translate, colSpan, "class=\"DataTD\"");
}
public boolean shouldTranslate() {