Skip to main content
Module

x/cliffy/packages/table/README.md

Command line framework for deno πŸ¦• Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Go to Latest
File

Cliffy ❯ Table

Version Release date Deno version Build status issues Licence

Easy solution to render table’s on the command line
>_ Create cli table’s with border, padding, nested table’s, etc…

Usage

Simple table:

import { Table } from 'https://deno.land/x/cliffy/table.ts';

Table.from( [
        [ 'Flags', 'Description', 'Types' ],
        [ 'cell1', 'cell2', 'cell3' ],
        [ 'cell1', 'cell2', 'cell3' ],
        [ 'cell1', 'cell2', 'cell3' ]
    ] )
    .maxCellWidth( 50 )
    .padding( 1 )
    .indent( 2 )
    .border( true )
    .render();
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ Flags β”‚ Description β”‚ Types β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ cell1 β”‚ cell2       β”‚ cell3 β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ cell1 β”‚ cell2       β”‚ cell3 β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ cell1 β”‚ cell2       β”‚ cell3 β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”˜

Multiline rows:

import { Table } from 'https://deno.land/x/cliffy/table.ts';

Table.from( [
        [ 'Flags', 'Description', 'Types' ],
        [ 'cell1', 'cell2', 'cell3' ],
        [ 'cell1', 'Lorem ipsum dolor sit amet, at nam scripta fierent imperdiet. Et vim eruditi definitiones, quo cu accusamus mediocritatem. Graeci sapientem et eum. Cu dicat vivendum qui, ius percipit conceptam ne. Magna veniam ut his.', 'cell3' ],
        [ 'cell1', 'cell2', 'cell3' ]
    ] )
    .maxCellWidth( [ 10, 40, 10 ] )
    .padding( 1 )
    .indent( 2 )
    .border( true )
    .render();
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ Flags β”‚ Description                        β”‚ Types β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ cell1 β”‚ cell2                              β”‚ cell3 β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ cell1 β”‚ Lorem ipsum dolor sit amet, at nam β”‚ cell3 β”‚
  β”‚       β”‚ scripta fierent imperdiet. Et vim  β”‚       β”‚
  β”‚       β”‚ eruditi definitiones, quo cu       β”‚       β”‚
  β”‚       β”‚ accusamus mediocritatem. Graeci    β”‚       β”‚
  β”‚       β”‚ sapientem et eum. Cu dicat         β”‚       β”‚
  β”‚       β”‚ vivendum qui, ius percipit         β”‚       β”‚
  β”‚       β”‚ conceptam ne. Magna veniam ut his. β”‚       β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ cell1 β”‚ cell2                              β”‚ cell3 β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”˜

License

MIT