W3cubDocs

/Nushell

table for viewers

Render the table.

Signature

> table {flags}

Flags

  • --start-number, -n {int}: row number to start viewing from
  • --list, -l: list available table modes/themes
  • --width, -w {int}: number of terminal columns wide (not output columns)
  • --expand, -e: expand the table structure in a light mode
  • --expand-deep, -d {int}: an expand limit of recursion which will take place
  • --flatten, -: Flatten simple arrays
  • --flatten-separator, - {string}: sets a separator when 'flatten' used
  • --collapse, -c: expand the table structure in collapse mode. Be aware collapse mode currently doesn't support width control

Input/output types:

input output
any any

Examples

List the files in current directory, with indexes starting from 1.

>ls|table-n1

Render data in table view

> [[ab]; [12] [34]] |table
╭───┬───┬───╮
# │ a │ b │
├───┼───┼───┤
012
134
╰───┴───┴───╯

Render data in table view (expanded)

> [[ab]; [12] [2 [44]]] |table--expand
╭───┬───┬───────────╮
# │ a │     b     │
├───┼───┼───────────┤
012
12╭───┬───╮
04
14
╰───┴───╯
╰───┴───┴───────────╯

Render data in table view (collapsed)

> [[ab]; [12] [2 [44]]] |table--collapse
╭───┬───╮
ab
├───┼───┤
12
├───┼───┤
24
├───┤
4
╰───┴───╯

Notes

If the table contains a column called 'index', this column is used as the table index instead of the usual continuous index.

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/table.html