1) due to crossed references between others java modules, I can not update to a newer version at the moment 2) The requested snippet of code
//I insert a new CTTbl in the list of BodyElements in the correct position, below the original table CTTbl replica = template.getDocument().getBody().insertNewTbl(tablePosition); //I clone the table body, avoiding references towards original elements replica.set(original.getCTTbl()); //I create a new XWPFTable using replicated CTTbl XWPFTable table2 = new XWPFTable(replica, template); //I insert the XWPFTable replica in the list of XWPFTable template.insertTable(tablePosition, table2); Doing so I have the replicas in the correct position inside the document. I tried to create an XmlCursor using CTTbl object, but new paragraphs appears in wrong positions On Thu, Nov 17, 2016 at 5:50 PM, Javen O'Neal <[email protected]> wrote: > Have you tried using POI 3.15? > > Can you share a simplified code snippet to show what you're doing? > > On Nov 17, 2016 08:22, "massimo malvestio" <[email protected]> > wrote: > > > Hi everybody! I'm facing an issue I can't solve using XWPFDocument to > > manipulate a 2010 docx. > > > > Document structure > > > > <Table1> > > <Empty paragraph> > > <Table2> > > > > I need to replicate Table1 n times, and replicas must appear under > orginal > > table. > > > > Replication works, positioning works, BUT, replicas appear as merged in a > > single table when I open the docx using Word. > > > > I tried to insert empty paragraphs between replicas, as suggested in > > http://answers.microsoft.com/en-us/msoffice/forum/msoffice_ > > word-mso_winother/prevent-tables-from-merging/56fd7424- > > 5a8a-43ca-9127-10e82f18e46f, > > but I can't put them in the correct position. > > > > So, how can I precisely insert a paragraph between two tables? > > > > Thanks in advance > > >
