class IncTable {

    private Map<String, String> props = new HashMap<>();
    private List<List<PdfPCell>> rows = new ArrayList<>();
    private List<PdfPCell> cols;

    public IncTable(Map<String, String> props) {
        this.props.putAll(props);
    }

    public void addCol(PdfPCell cell) {<FILL_FUNCTION_BODY>}

    public void addCols(List<PdfPCell> ncols) {
        if (cols == null) {
            cols = new ArrayList<>(ncols);
        } else {
            cols.addAll(ncols);
        }
    }

    public void endRow() {
        if (cols != null) {
            Collections.reverse(cols);
            rows.add(cols);
            cols = null;
        }
    }

    public List<List<PdfPCell>> getTableRows() {
        return rows;
    }

    public PdfPTable buildTable() {
        if (rows.isEmpty()) {
            return new PdfPTable(1);
        }
        int ncol = 0;
        for (PdfPCell pCell : rows.get(0)) {
            ncol += pCell.getColspan();
        }
        PdfPTable table = new PdfPTable(ncol);
        String width = props.get("width");
        if (width == null) {
            table.setWidthPercentage(100);
        } else {
            if (width.endsWith("%")) {
                table.setWidthPercentage(Float.parseFloat(width.substring(0, width.length() - 1)));
            } else {
                table.setTotalWidth(Float.parseFloat(width));
                table.setLockedWidth(true);
            }
        }
        for (List<PdfPCell> col : rows) {
            for (PdfPCell pdfPCell : col) {
                table.addCell(pdfPCell);
            }
        }
        return table;
    }
}

        if (cols == null) {
            cols = new ArrayList<>();
        }
        cols.add(cell);
    
<no_super_class>