cellBox.width = 0; for (int j = 0; j < cellBox.colspan; j++) cellBox.width += table.columns[col + j];
cellBox.contentWidth = 0; for (int j = 0; j < cellBox.colspan; j++) cellBox.contentWidth += table.columns[col + j]; cellBox.contentWidth += (cellBox.colspan - 1) * borderSpacingHorizontal; cellBox.width = cellBox.contentWidth;
    private static void layoutCells(List cells, Context c, RowBox row, TableBox table, boolean fixed, int borderSpacingHorizontal) {        int col = 0;        for (Iterator i = cells.iterator(); i.hasNext();) {            TableCellContent tcc = (TableCellContent) i.next();            CellBox cellBox = new CellBox();            c.translate(row.width, 0);            c.setShrinkWrap();            cellBox = (CellBox) layoutCell(c, cellBox, tcc, fixed, table, col);            c.unsetShrinkWrap();            c.translate(-row.width, 0);            row.addChild(cellBox);            cellBox.setParent(row);            cellBox.element = tcc.getElement();            // set the child_box location            cellBox.x = row.width + borderSpacingHorizontal;            row.y = 0;            // increase the final layout width if the child was greater            if (cellBox.height > row.height) {                row.height = cellBox.height;            }            checkColumns(table, col + cellBox.colspan);            int width = 0;            for (int j = 0; j < cellBox.colspan; j++) width += table.columns[col + j];            if (!fixed && cellBox.width > width) {                int extra = (cellBox.width - width) / cellBox.colspan;                for (int j = 0; j < cellBox.colspan; j++) table.columns[col + j] += extra;            }            cellBox.width = 0;            for (int j = 0; j < cellBox.colspan; j++) cellBox.width += table.columns[col + j];            row.width = cellBox.x + cellBox.width;            col += cellBox.colspan;        }    }