code: public XWPFTable insertNewTable(XWPFRun run, int row, int col) {
          XmlCursor cursor = ((XWPFParagraph) run.getParent()).getCTP().newCursor();
  
          // XmlCursor cursor = run.getCTR().newCursor();
          if (isCursorInBody(cursor)) {
              String uri = CTTbl.type.getName().getNamespaceURI();
              String localPart = "tbl";
              cursor.beginElement(localPart, uri);
              cursor.toParent();
  
              CTTbl t = (CTTbl) cursor.getObject();
              XWPFTable newT = new XWPFTable(t, this, row, col);
              XmlObject o = null;
              while (!(o instanceof CTTbl) && (cursor.toPrevSibling())) {
                  o = cursor.getObject();
              }
              if (!(o instanceof CTTbl)) {
                  tables.add(0, newT);
              } else {
                  int pos = tables.indexOf(getTable((CTTbl) o)) + 1;
                  tables.add(pos, newT);
              }
              int i = 0;
              XmlCursor tableCursor = t.newCursor();
              try {
                  cursor.toCursor(tableCursor);
                  while (cursor.toPrevSibling()) {
                      o = cursor.getObject();
                      if (o instanceof CTP || o instanceof CTTbl) {
                          i++;
                      }
                  }
                  bodyElements.add(i > bodyElements.size() ? bodyElements.size() : i, newT);
                  // bodyElements.add(i, newT);
                  cursor.toCursor(tableCursor);
                  cursor.toEndToken();
                  return newT;
              }
              finally {
                  tableCursor.dispose();
              }
          }
          return null;
      }
docs: 在某个段落起始处插入表格
  
  @param run
  @param row
  @param col
  @return