@Deprecated public List<Object> getEGContentRowContent() { return getContent(); }
tbl.setTblPr(tblPr); tbl.setTblGrid(tblGrid); tbl.getEGContentRowContent().add(tr);
if (tbl.getTblPr()!=null && tbl.getTblPr().getTblStyle()!=null) { styleId = tbl.getTblPr().getTblStyle().getVal(); this.tblGrid = tbl.getTblGrid(); this.tblPr = tbl.getTblPr();
myTbl.setTblPr(tblpr);
protected void setupTblGrid(TableBox cssTable, Tbl tbl, TableProperties tableProperties) { // Word can generally open a table without tblGrid: // <w:tblGrid> // <w:gridCol w:w="4621"/> // <w:gridCol w:w="4621"/> // </w:tblGrid> // but for an AutoFit table (most common), it // is the w:gridCol val which prob specifies the actual width TblGrid tblGrid = Context.getWmlObjectFactory().createTblGrid(); tbl.setTblGrid(tblGrid); int[] colPos = tableProperties.getColumnPos(); log.debug("setupTblGrid " + cssTable.numEffCols() + " " + colPos.length); for (int i=1; i<=cssTable.numEffCols(); i++) { TblGridCol tblGridCol = Context.getWmlObjectFactory().createTblGridCol(); tblGrid.getGridCol().add(tblGridCol); log.debug("colpos=" + colPos[i]); tblGridCol.setW( BigInteger.valueOf(colPos[i]-colPos[i-1]) ); } }
/** * Create an instance of {@link Tbl } * */ public Tbl createTbl() { return new Tbl(); }
tbl.setTblPr(tblPr);
/** * Create an instance of {@link Tbl } * */ public Tbl createTbl() { return new Tbl(); }
Tr tr = null; Tc tc = null; for (Object elemTr:table.getContent()) { if (elemTr instanceof JAXBElement) { elemTr = ((JAXBElement)elemTr).getValue();
tbl.setTblPr(tblPr); tbl.setTblGrid(tblGrid); tbl.getEGContentRowContent().add(tr);
/** * Get table cell width from tc and table style from tbl and set it to xHTMLImporter. * @param tbl * @param tc * @param xHTMLImporter */ public static void setupMaxWidthAndStyleForTc(Tbl tbl, Tc tc, XHTMLImporter xHTMLImporter) { if(tc.getTcPr() != null && tc.getTcPr().getTcW() != null) { TblWidth tcW = tc.getTcPr().getTcW(); if (tcW.getW()!= null && tcW.getType().equals(TblWidth.TYPE_DXA)) { int maxWidth = tcW.getW().intValue(); String styleVal = null; if(tbl != null && tbl.getTblPr() != null && tbl.getTblPr().getTblStyle() != null) { styleVal = tbl.getTblPr().getTblStyle().getVal(); } log.debug("inserting in a tc, with maxwidth: " + maxWidth + ", and table style: " + styleVal); xHTMLImporter.setMaxWidth(maxWidth, styleVal); } else { log.debug("w:tcPr/w:tcW present, but width not in dxa units "); } } else { log.debug("w:tcPr/w:tcW not present"); } } }
if (tbl.getTblPr()!=null && tbl.getTblPr().getTblStyle()!=null) { styleId = tbl.getTblPr().getTblStyle().getVal(); this.tblGrid = tbl.getTblGrid(); this.tblPr = tbl.getTblPr();
private void render(final TableRow node, final DocxRendererContext docx) { Tr savedTr = myTr; myTr = docx.getFactory().createTr(); myTbl.getContent().add(myTr); // Create object for trPr TrPr trpr = docx.getFactory().createTrPr(); myTr.setTrPr(trpr); if (node.getParent() instanceof TableHead) { // Create object for tblHeader (wrapped in JAXBElement) BooleanDefaultTrue booleandefaulttrue = docx.getFactory().createBooleanDefaultTrue(); JAXBElement<org.docx4j.wml.BooleanDefaultTrue> booleandefaulttrueWrapped = docx.getFactory().createCTTrPrBaseTblHeader(booleandefaulttrue); trpr.getCnfStyleOrDivIdOrGridBefore().add(booleandefaulttrueWrapped); } docx.renderChildren(node); myTr = savedTr; }
Style s = pr.getEffectiveTableStyle(tbl.getTblPr() );
@Deprecated public List<Object> getEGContentRowContent() { return getContent(); }
public Tr copyRow(Tr row) { Tr copiedRow = XmlUtils.deepCopy(row); new TraversalUtil(copiedRow, INVARIANTS_SETTER);//set parent for each sub-element of copied row (otherwise parent would be JaxbElement) int index = table.getContent().indexOf(row); table.getContent().add(index, copiedRow); return copiedRow; }