/** * returns the XWPFTableCell which belongs to the CTTC cell * if there is no XWPFTableCell which belongs to the parameter CTTc cell null will be returned */ public XWPFTableCell getTableCell(CTTc cell) { for (int i = 0; i < tableCells.size(); i++) { if (tableCells.get(i).getCTTc() == cell) return tableCells.get(i); } return null; }
private void mergeCellsHorizontal(XWPFTable table, int row, int startCol,int endCol) { for (int cellIndex = startCol; cellIndex <= endCol; cellIndex++) { XWPFTableCell cell = table.getRow(row).getCell(cellIndex); if (cellIndex == startCol) { cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.RESTART); } else { cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.CONTINUE); } } }
private void mergeCellsVertically(XWPFTable table, int col, int fromRow,int toRow) { for (int rowIndex = fromRow; rowIndex <= toRow; rowIndex++) { XWPFTableCell cell = table.getRow(rowIndex).getCell(col); if (rowIndex == fromRow) { cell.getCTTc().addNewTcPr().addNewVMerge() .setVal(STMerge.RESTART); } else { cell.getCTTc().addNewTcPr().addNewVMerge().setVal(STMerge.CONTINUE); } } }
for (int j = 0; j < fragment.length; j++) { if (0 == j) { CTTc ctTc = cell.getCTTc(); CTP ctP = (ctTc.sizeOfPArray() == 0) ? ctTc.addNewP() : ctTc.getPArray(0); par = new XWPFParagraph(ctP, cell);
/** * returns the XWPFTableCell which belongs to the CTTC cell * if there is no XWPFTableCell which belongs to the parameter CTTc cell null will be returned */ public XWPFTableCell getTableCell(CTTc cell) { for (int i = 0; i < tableCells.size(); i++) { if (tableCells.get(i).getCTTc() == cell) return tableCells.get(i); } return null; }
continue; tableCell.getCTTc().addNewTcPr().addNewTcW().setW(BigInteger.valueOf(DxaUtils.points2dxa(width))); buildTableCellStyle(table,tableCell,cell,rowNumber,colNumber);
/** * returns the XWPFTableCell which belongs to the CTTC cell * if there is no XWPFTableCell which belongs to the parameter CTTc cell null will be returned */ public XWPFTableCell getTableCell(CTTc cell) { for(int i=0; i<tableCells.size(); i++){ if (tableCells.get(i).getCTTc() == cell) return tableCells.get(i); } return null; }
public CTTcPr getTcPr( XWPFTableCell cell ) { CTTc tc = cell.getCTTc(); if ( tc == null ) { return null; } return tc.getTcPr(); }
public CTTcPr getTcPr( XWPFTableCell cell ) { CTTc tc = cell.getCTTc(); if ( tc == null ) { return null; } return tc.getTcPr(); }
CellStyle rowStyle=cell.getRow().getCustomCellStyle(); CellStyle colStyle=cell.getColumn().getCustomCellStyle(); CTTcPr cellProperties = tableCell.getCTTc().addNewTcPr(); Border leftBorder=style.getLeftBorder(); Border rightBorder=style.getRightBorder();
for(int x = 0;x < table.getNumberOfRows(); x++){ XWPFTableRow row = table.getRow(x); int numberOfCell = row.getTableCells().size(); for(int y = 0; y < numberOfCell ; y++){ XWPFTableCell cell = row.getCell(y); cell.getCTTc().addNewTcPr().addNewTcW().setW(BigInteger.valueOf(2000)); } }
private void mergeCellsHorizontal(XWPFTable table, int row, int startCol,int endCol) { for (int cellIndex = startCol; cellIndex <= endCol; cellIndex++) { XWPFTableCell cell = table.getRow(row).getCell(cellIndex); if (cellIndex == startCol) { cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.RESTART); } else { cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.CONTINUE); } } }
private void mergeCellsVertically(XWPFTable table, int col, int fromRow,int toRow) { for (int rowIndex = fromRow; rowIndex <= toRow; rowIndex++) { XWPFTableCell cell = table.getRow(rowIndex).getCell(col); if (rowIndex == fromRow) { cell.getCTTc().addNewTcPr().addNewVMerge() .setVal(STMerge.RESTART); } else { cell.getCTTc().addNewTcPr().addNewVMerge().setVal(STMerge.CONTINUE); } } }
public static TableWidth getTableWidth( XWPFTableCell cell ) { float width = 0; boolean percentUnit = false; CTTcPr tblPr = cell.getCTTc().getTcPr(); if ( tblPr.isSetTcW() ) { CTTblWidth tblWidth = tblPr.getTcW(); return getTableWidth( tblWidth ); } return new TableWidth( width, percentUnit ); }
public static TableWidth getTableWidth( XWPFTableCell cell ) { float width = 0; boolean percentUnit = false; CTTcPr tblPr = cell.getCTTc().getTcPr(); if ( tblPr.isSetTcW() ) { CTTblWidth tblWidth = tblPr.getTcW(); return getTableWidth( tblWidth ); } return new TableWidth( width, percentUnit ); }