From 472e110e96de8f2b71766f793d1f498eb87c2cdf Mon Sep 17 00:00:00 2001 From: Janis Streib Date: Fri, 27 Jun 2014 02:26:36 +0200 Subject: [PATCH 1/1] Correct colspan handling --- src/org/cacert/gigi/output/DataTable.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/org/cacert/gigi/output/DataTable.java b/src/org/cacert/gigi/output/DataTable.java index 3f131a22..771a0c2a 100644 --- a/src/org/cacert/gigi/output/DataTable.java +++ b/src/org/cacert/gigi/output/DataTable.java @@ -24,10 +24,12 @@ public class DataTable implements Outputable { } } out.println(""); + int cellsRendered = 0; for (int i = 0; i < mesCells / columnCount; i++) { out.println(""); for (int j = 0; j < columnCount;) { - Cell current = cells.get((i * columnCount) + j); + Cell current = cells.get(cellsRendered); + cellsRendered++; j += current.getColSpan(); out.println("
"); out.print(current.shouldTranslate() ? l.getTranslation(current @@ -53,6 +55,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; } -- 2.39.2