code: @SuppressWarnings("unused")
      // TODO 
      private static void widthTable(XWPFTable table, float[] colWidths) {
          float widthCM = 0;
          for (float w : colWidths) {
              widthCM += w;
          }
          long width = (int) (widthCM / 2.54 * 1440);
          CTTblPr tblPr = getTblPr(table);
          CTTblWidth tblW = tblPr.isSetTblW() ? tblPr.getTblW() : tblPr.addNewTblW();
          tblW.setType(0 == width ? STTblWidth.AUTO : STTblWidth.DXA);
          tblW.setW(BigInteger.valueOf(width));
  
          if (0 != width) {
              CTTblGrid tblGrid = table.getCTTbl().getTblGrid();
              if (null == tblGrid) {
                  tblGrid = table.getCTTbl().addNewTblGrid();
              }
  
              for (float w : colWidths) {
                  CTTblGridCol addNewGridCol = tblGrid.addNewGridCol();
                  addNewGridCol.setW(BigInteger.valueOf((long) (w / 2.54 * 1440)));
              }
          }
      }
docs: 设置表格每列的宽度
  
  @param table
  表格对象
  @param widths
  每列的宽度，单位CM