/** * inserts a new tablerow * * @param pos * @return the inserted row */ public XWPFTableRow insertNewTableRow(int pos) { if (pos >= 0 && pos <= tableRows.size()) { CTRow row = ctTbl.insertNewTr(pos); XWPFTableRow tableRow = new XWPFTableRow(row, this); tableRows.add(pos, tableRow); return tableRow; } return null; }
/** * add a new Row to the table * at position pos * * @param row the row which should be added */ public boolean addRow(XWPFTableRow row, int pos) { if (pos >= 0 && pos <= tableRows.size()) { ctTbl.insertNewTr(pos); ctTbl.setTrArray(pos, row.getCtRow()); tableRows.add(pos, row); return true; } return false; }
/** * inserts a new tablerow * @param pos * @return the inserted row */ public XWPFTableRow insertNewTableRow(int pos){ if(pos >= 0 && pos <= tableRows.size()){ CTRow row = ctTbl.insertNewTr(pos); XWPFTableRow tableRow = new XWPFTableRow(row, this); tableRows.add(pos, tableRow); return tableRow; } return null; }
/** * inserts a new tablerow * * @param pos * @return the inserted row */ public XWPFTableRow insertNewTableRow(int pos) { if (pos >= 0 && pos <= tableRows.size()) { CTRow row = ctTbl.insertNewTr(pos); XWPFTableRow tableRow = new XWPFTableRow(row, this); tableRows.add(pos, tableRow); return tableRow; } return null; }
/** * add a new Row to the table * at position pos * @param row the row which should be added */ public boolean addRow(XWPFTableRow row, int pos){ if(pos >= 0 && pos <= tableRows.size()){ ctTbl.insertNewTr(pos); ctTbl.setTrArray(pos,row.getCtRow()); tableRows.add(pos, row); return true; } return false; }
/** * add a new Row to the table * at position pos * * @param row the row which should be added */ public boolean addRow(XWPFTableRow row, int pos) { if (pos >= 0 && pos <= tableRows.size()) { ctTbl.insertNewTr(pos); ctTbl.setTrArray(pos, row.getCtRow()); tableRows.add(pos, row); return true; } return false; }
private void copyTableRow(final XWPFTable posTbl, final int rowCounter) { XWPFTableRow rowToCopy = posTbl.getRow(1); CTRow row = posTbl.getCTTbl().insertNewTr(rowCounter); row.set(rowToCopy.getCtRow()); XWPFTableRow copyRow = new XWPFTableRow(row, posTbl); posTbl.getRows().add(rowCounter, copyRow); }