Type of a dataset row.
Type of the dynamic columns.
Creates a new Table
instance.
the dataset
the config
The table config.
The dataset.
The row containing the accumulated data.
The column names. Including the dynamic and origin column names
The maximum width of each column.
The table width.
A flag to check whether the header or body has changed since the last build. Prevents unnecessary builds.
Builds the table.
For performance reasons the table is only built if Table.touched is true
.
force the build
Builds the body.
the build body
Builds the given body cell content.
the cell's row
the cell's column
the built cell content
Builds the peek row.
The placeholder row for the hidden rows if the peek
config is set.
the peek row
Builds the given body row.
the row
the built row content
Builds the horizontal border for the given row.
the row
the horizontal row border
Builds a cell content array.
the cell's left padding
the cell's text
the cell's right padding
the cell content
Builds the column names from the dataset in the right order. The result is stored in Table.columnNames.
All column names are converted to string
in order to avoid
complications when using arrays and numbers and indices.
Merges the user dataset with the dynamic columns.
the new dataset
Builds an empty cell content.
the cell's column
the empty cell content
Builds the header.
the built header
Builds the given header cell content.
the cell's column
the built cell content
Builds the subsequent lines (overflow) of the given row.
Set row=0
for the header.
the initial row
the text overflow for each solumn
the subsequent lines
Builds the row separator.
the separator character
the row separator string
Computes the rows of the accumulated columns.
the calculated rows
Calculates the body cell padding.
the cell's row
the cell's column
the cell padding
Calculates the width of all columns. The result is stored in Table.columnWidths
Calculates the header cell padding. The padding is based on the column's width and its display name.
the cell's column
the cell padding
Calculates the width of the complete table. The table width is based on the width of the columns, the padding and the border.
the table width
Exports the plain table to the given file (without advanced style).
the filepath
the file's open mode
Formats the content of the given body cell.
the cell's row
the cell's column
the cell's content
the formatted cell content
Formats the content of the given body row.
the cell's row
the rows's content
the formatted row content
Formats the content of the given header cell. The return value includes also the content's length because the content also contains ANSI escape codes.
cell's column
cell's content
the formatted cell content and its length
Gets the text of given the given cell.
the cell's row
the cell's column
whether the text should be cropped or not.
the cell text
Gets the display name of the given column.
the column
whether the column name should be cropped or not.
the column's display name string
Gets the index of the given column.
the column's name
the column's index
Gets the width of the given column.
the column
the column's text width
Get the width of the console window. Padding is substracted from the width.
the console width
Gets the value of the given cell in the dataset.
the cell's row
the cell's col
the cell's value
Gets the character padding of the given size
.
the padding size
the character padding
Checks whether the given text is a border
character.
the text to check
whether the text is a border
character
Parses the given cell text to String
.
the text to parse
the parsed cell text
Prints the table to the console.
clear the console before printing
Prints the plain (unstyled) table to the console.
Sorts the dataset by the columns provided in Table._config.
Gets the table as plain string without any advanced styling. Can be used for example to write the table to a file or to paste it anywhere as text.
the plain table string
Gets the table as string. Can be used to print the table on the console.
the table string
Generated using TypeDoc
Represent a dataset in tabular form. The columns are infered from the dataset's first item.