row.addChild(cellBox);
    private static void layoutCells(List cells, LayoutContext c, RowBox row, TableBox table, boolean fixed, int borderSpacingHorizontal, int borderSpacingVertical) {        int col = 0;        for (Iterator i = cells.iterator(); i.hasNext() && !c.shouldStop();) {            checkColumns(table, col + 1);            while (table.columnRows[col] != 0) {                row.contentWidth += borderSpacingHorizontal + table.columns[col];                table.columnCell[col] = null;                col = col + 1;            }            TableCellContent tcc = (TableCellContent) i.next();            CellBox cellBox = new CellBox();            c.translate(row.contentWidth, 0);            c.setShrinkWrap();            cellBox = (CellBox) layoutCell(c, cellBox, tcc, fixed, table, col);            c.unsetShrinkWrap();            c.translate(-row.contentWidth, 0);            row.addChild(cellBox);            cellBox.setParent(row);            cellBox.element = tcc.getElement();            // set the child_box location            cellBox.x = row.contentWidth + borderSpacingHorizontal;            //row.y = 0;            checkColumns(table, col + cellBox.colspan);            for (int j = 0; j < cellBox.colspan; j++) {                table.columnRows[col + j] = cellBox.rowspan;                table.columnHeight[col + j] = cellBox.height;                table.columnCell[col + j] = null;            }            table.columnCell[col] = cellBox;            int width = 0;            for (int j = 0; j < cellBox.colspan; j++) width += table.columns[col + j];            width += borderSpacingHorizontal * (cellBox.colspan - 1);            if (!fixed && cellBox.getWidth() > width) {                int extra = (cellBox.getWidth() - width) / cellBox.colspan;                for (int j = 0; j < cellBox.colspan; j++) table.columns[col + j] += extra;            }            cellBox.contentWidth = 0;            for (int j = 0; j < cellBox.colspan; j++) cellBox.contentWidth += table.columns[col + j];            cellBox.contentWidth += (cellBox.colspan - 1) * borderSpacingHorizontal;            cellBox.contentWidth -= cellBox.leftPadding + cellBox.rightPadding;            row.contentWidth = cellBox.x + cellBox.getWidth();            col += cellBox.colspan;            //this will be fixed again later!            cellBox.height = 0;        }        for (int j = 0; j < table.columns.length; j++) {            // increase the final layout height if the child was greater            int height = table.columnHeight[j] / table.columnRows[j];            if (height > row.height) {                row.height = height;            }            table.columnHeight[j] -= height;            table.columnRows[j]--;        }        for (int j = 0; j < table.columns.length; j++) {            if (table.columnCell[j] == null) continue;            table.columnCell[j].height += row.height;            if (table.columnRows[j] != 0) {                table.columnCell[j].height += borderSpacingVertical;            }        }    }