Function calcTableHeight

  • Calculates the total height of a table and the height of each row. If overrideHeights are provided, it uses them to calculate the total height instead.

    Returns

    An object containing the total height of the table and an array of heights for each row.

    Parameters

    • table: CellContent[][]

      The table data as a 2D array of cell contents.

    • columnWidths: number[]

      The widths of each column in the table.

    • font: default

      The default font for table content.

    • textSize: number

      The default font size for table content.

    • lineHeight: number

      The default line height for table content.

    • hasHeader: boolean

      Indicates whether the table has a header row.

    • headerFont: default

      The font for the header row.

    • headerTextSize: number

      The font size for the header row.

    • headerLineHeight: number

      The line height for the header row.

    • horizontalWrapMargin: number

      The horizontal margin for wrapping text in cells.

    • verticalMargin: number

      The vertical margin for cells.

    • borderMargin: number

      The margin for the border of the table.

    • Optional tableTitle: string

      The optional title of the table.

    • Optional tableTitleTextSize: number

      The optional font size for the table title.

    • Optional overrideHeights: number[]

      Optional array of heights to override the calculated row heights.

    Returns Promise<{
        rowHeights: number[];
        totalHeight: number;
    }>

Generated using TypeDoc