public static XWPFTableCell getEmbeddedTableCell( XWPFParagraph paragraph ) { IBody body = paragraph.getBody(); if ( body != null && body.getPartType() == BodyType.TABLECELL ) { return (XWPFTableCell) body; } return null; } }
public static XWPFTableCell getEmbeddedTableCell( XWPFParagraph paragraph ) { IBody body = paragraph.getBody(); if ( body != null && body.getPartType() == BodyType.TABLECELL ) { return (XWPFTableCell) body; } return null; } }
for (XWPFParagraph para: paras) { XmlCursor cursor = (XmlCursor) para.getCTP().newCursor(); XWPFTable newTable = para.getBody().insertNewTbl(cursor); //Generate your XWPF table based on what's inside para with your own logic }
if (config.getIncludeShapeBasedContent()) { for (XmlObject embeddedParagraph : paragraph.getCTP().selectPath("declare namespace w='http://schemas.openxmlformats.org/wordprocessingml/2006/main' declare namespace wps='http://schemas.microsoft.com/office/word/2010/wordprocessingShape' .//*/wps:txbx/w:txbxContent//w:p")) { extractParagraph(new XWPFParagraph(CTP.Factory.parse(embeddedParagraph.xmlText()), paragraph.getBody()), listManager, xhtml);
IBody body = paragraph.getBody(); List<IBodyElement> bodyElements = body.getBodyElements(); if ( body.getPartType() == BodyType.TABLECELL && bodyElements.size() == 1 )
IBody body = paragraph.getBody(); List<IBodyElement> bodyElements = body.getBodyElements(); if ( body.getPartType() == BodyType.TABLECELL && bodyElements.size() == 1 )
IBody body = paragraph.getBody(); List<IBodyElement> bodyElements = body.getBodyElements(); if ( body.getPartType() == BodyType.TABLECELL && bodyElements.size() == 1 )
XWPFTable nestedTable = p.getBody().insertNewTbl(cursor);
extractParagraph(new XWPFParagraph(CTP.Factory.parse(embeddedParagraph.xmlText()), paragraph.getBody()), listManager, xhtml);
extractParagraph(new XWPFParagraph(CTP.Factory.parse(embeddedParagraph.xmlText()), paragraph.getBody()), listManager, xhtml);