## table-layout * [table-layout](#module_table-layout) * [Table](#exp_module_table-layout--Table) ⏏ * [new Table(data, [options])](#new_module_table-layout--Table_new) * [table.load(data)](#module_table-layout--Table+load) * [table.renderLines()](#module_table-layout--Table+renderLines) ⇒ Array.<string> * [table.toString()](#module_table-layout--Table+toString) ⇒ string * [Table~columnOption](#module_table-layout--Table..columnOption) ### Table ⏏ Recordset data in (array of objects), text table out. **Kind**: Exported class #### new Table(data, [options]) **Params** - data Array.<object> - input data - [options] object - optional settings - [.maxWidth] number - maximum width of layout - [.noWrap] boolean - disable wrapping on all columns - [.noTrim] boolean - disable line-trimming - [.break] boolean - enable word-breaking on all columns - [.columns] [columnOption](#module_table-layout--Table..columnOption) - array of column-specific options - [.ignoreEmptyColumns] boolean - If set, empty columns or columns containing only whitespace are not rendered. - [.padding] object - Padding values to set on each column. Per-column overrides can be set in the `options.columns` array. - [.left] string - Defaults to a single space. - [.right] string - Defaults to a single space. - [.eol] string - EOL character used. Defaults to `\n`. #### table.load(data) Set the input data to display. Must be an array of objects. **Kind**: instance method of [Table](#exp_module_table-layout--Table) **Params** - data Array.<object> #### table.renderLines() ⇒ Array.<string> Identical to `.toString()` with the exception that the result will be an array of lines, rather than a single, multi-line string. **Kind**: instance method of [Table](#exp_module_table-layout--Table) #### table.toString() ⇒ string Returns the input data as a text table. **Kind**: instance method of [Table](#exp_module_table-layout--Table) #### Table~columnOption **Kind**: inner typedef of [Table](#exp_module_table-layout--Table) **Properties** | Name | Type | Description | | --- | --- | --- | | name | string | column name, must match a property name in the input | | [width] | number | A specific column width. Supply either this or a min and/or max width. | | [minWidth] | number | column min width | | [maxWidth] | number | column max width | | [nowrap] | boolean | disable wrapping for this column | | [break] | boolean | enable word-breaking for this columns | | [padding] | object | padding options | | [padding.left] | string | a string to pad the left of each cell (default: `' '`) | | [padding.right] | string | a string to pad the right of each cell (default: `' '`) | | [get] | function | A getter function to return the cell value, the function receives the existing cell value. Signature: `function (cellValue) { // return the desired cell value }` |