by jason » Fri Aug 04, 2017 11:13 am
See the TblFactory class which contains a method createTable(int rows, int cols, int cellWidthTwips)
But these days the better way to do things is to create a table formatted as you'd like in Word, then use the Docx4j Helper AddIn, or docx4j webapp, to generate corresponding Java code.
To add your table at a specific position in the document, well, assuming WordprocessingMLPackage wordMLPackage and that you want to do that at the top level of content, wordMLPackage.getMainDocumentPart().getContent() gives you access to List<Object> so you can use add(int index, E element) to insert the specified element at the specified position