function normalizeTable() {
  const doc = this.document;
  const opts = this.opts;

  // Normalize config
  let index = doc._tableIndex++;
  this._id = new String(opts.id ?? `table-${index}`);
  this._position = {
    x: doc.sizeToPoint(opts.position?.x, doc.x),
    y: doc.sizeToPoint(opts.position?.y, doc.y),
  };
  this._maxWidth = doc.sizeToPoint(
    opts.maxWidth,
    doc.page.width - doc.page.margins.right - this._position.x,
  );

  const { defaultStyle, defaultColStyle, defaultRowStyle } =
    normalizedDefaultStyle(opts.defaultStyle);
  this._defaultStyle = defaultStyle;

  let colStyle;
  if (opts.columnStyles) {
    if (Array.isArray(opts.columnStyles)) {
      colStyle = (i) => opts.columnStyles[i];
    } else if (typeof opts.columnStyles === 'function') {
      // memoize all columns
      colStyle = memoize((i) => opts.columnStyles(i), Infinity);
    } else if (typeof opts.columnStyles === 'object') {
      colStyle = () => opts.columnStyles;
    }
  }
  if (!colStyle) colStyle = () => ({});
  this._colStyle = normalizedColumnStyle.bind(this, defaultColStyle, colStyle);

  let rowStyle;
  if (opts.rowStyles) {
    if (Array.isArray(opts.rowStyles)) {
      rowStyle = (i) => opts.rowStyles[i];
    } else if (typeof opts.rowStyles === 'function') {
      // Memoize the row configs in a rolling buffer
      rowStyle = memoize((i) => opts.rowStyles(i), 10);
    } else if (typeof opts.rowStyles === 'object') {
      rowStyle = () => opts.rowStyles;
    }
  }
  if (!rowStyle) rowStyle = () => ({});
  this._rowStyle = normalizedRowStyle.bind(this, defaultRowStyle, rowStyle);
}
Normalize a table

@this PDFTable
@memberOf PDFTable
@private