Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

m: fix output of command example when displaying expanded/collapsed table #1120

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions commands/docs/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,32 @@ Render data in table view
Render data in table view (expanded)
```nu
> [[a b]; [1 2] [2 [4 4]]] | table --expand
╭───┬───┬───╮
│ # │ a │ b │
├───┼───┼───┤
│ 0 │ 1 │ 2 │
│ 1 │ 3 │ 4 │
╰───┴───┴───╯
╭───┬───┬───────────╮
│ # │ a │ b │
├───┼───┼───────────┤
│ 0 │ 1 │ 2 │
│ 1 │ 2 │ ╭───┬───╮ │
│ │ │ │ 0 │ 4 │ │
│ │ │ │ 1 │ 4 │ │
│ │ │ ╰───┴───╯ │
╰───┴───┴───────────╯

```

Render data in table view (collapsed)
```nu
> [[a b]; [1 2] [2 [4 4]]] | table --collapse
╭───┬───┬───╮
│ # │ a │ b │
├───┼───┼───┤
│ 0 │ 1 │ 2 │
│ 1 │ 3 │ 4 │
╰───┴───┴───╯
╭───┬───╮
│ a │ b │
├───┼───┤
│ 1 │ 2 │
├───┼───┤
│ 2 │ 4 │
│ ├───┤
│ │ 4 │
╰───┴───╯

```

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