Class Table

Represents a table with headers and rows.

Constructors

  • Creates a new instance of the Table class.

    Parameters

    • headers: string[]

      The headers of the table.

    Returns Table

Properties

headers: string[]
rows: string[][]

Methods

  • Adds a row to the table.

    Parameters

    • row: string[]

      The row to be added.

    Returns void

  • Clears all rows from the table.

    Returns void

  • Formats a row with proper padding.

    Parameters

    • row: string[]

      The row to be formatted.

    • maxLengths: number[]

      The maximum lengths of each column.

    Returns string

    The formatted row.

  • Gets the number of columns in the table.

    Returns number

    The number of columns.

  • Gets the number of rows in the table.

    Returns number

    The number of rows.

  • Logs the table to the console.

    Returns void

Generated using TypeDoc