function ensureColumnWidths(numCols) {
  // Compute the widths
  let starColumnIndexes = [];
  let starMinAcc = 0;
  let unclaimedWidth = this._maxWidth;

  for (let i = 0; i < numCols; i++) {
    let col = this._colStyle(i);
    if (col.width === '*') {
      starColumnIndexes[i] = col;
      starMinAcc += col.minWidth;
    } else {
      unclaimedWidth -= col.width;
      this._columnWidths[i] = col.width;
    }
  }

  let starColCount = starColumnIndexes.reduce((x) => x + 1, 0);

  if (starMinAcc >= unclaimedWidth) {
    // case 1 - there's no way to fit all columns within available width
    // that's actually pretty bad situation with PDF as we have no horizontal scroll
    starColumnIndexes.forEach((cell, i) => {
      this._columnWidths[i] = cell.minWidth;
    });
  } else if (starColCount > 0) {
    // Otherwise we distribute evenly factoring in the cell bounds
    starColumnIndexes.forEach((col, i) => {
      let starSize = unclaimedWidth / starColCount;
      this._columnWidths[i] = Math.max(starSize, col.minWidth);
      if (col.maxWidth > 0) {
        this._columnWidths[i] = Math.min(this._columnWidths[i], col.maxWidth);
      }
      unclaimedWidth -= this._columnWidths[i];
      starColCount--;
    });
  }

  let tempX = this._position.x;
  this._columnXPos = Array.from(this._columnWidths, (v) => {
    const t = tempX;
    tempX += v;
    return t;
  });
}
Compute the widths of the columns, ensuring to distribute the star widths

@this PDFTable
@memberOf PDFTable
@param {number} numCols
@private