public int getColumnCount() {
        int cols = 0;
        ArrayList<Integer> next = new ArrayList<Integer>();
        for (Row row : cells) {
            int rowCount = 0;
            if (!next.isEmpty()) {
                rowCount += next.get(0);
                next.remove(0);
            }
            for (Cell c : row.cells) {
                int width = 1;
                if (c.properties.colSpan != null && c.properties.colSpan > 1) {
                    width = c.properties.colSpan;
                }
                rowCount += width;
                if (c.properties.rowSpan != null && c.properties.rowSpan > 1) {
                    while (next.size() < c.properties.rowSpan - 1) {
                        next.add(0);
                    }
                    for (int i=1; i<c.properties.rowSpan; ++i) {
                        next.set(i - 1, next.get(i - 1) + width);
                    }
                }
            }
            cols = Math.max(cols, rowCount);
        }
        return cols;
    }
Helper class in order to write HTML tables
clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/statuspage/HtmlTable.java