Skip to content

Commit

Permalink
docs(table): update readme and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
c4spar committed Jul 26, 2020
1 parent 9c05cc3 commit df18516
Show file tree
Hide file tree
Showing 25 changed files with 598 additions and 499 deletions.
Binary file added assets/img/table/basic-usage.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/table/colspan-and-rowspan.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/table/header-and-body.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/table/random-table.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/table/rows-and-cells.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/table/table-options.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/table/using-as-array.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions examples/table/basic-usage.ts
@@ -0,0 +1,12 @@
#!/usr/bin/env -S deno run

import { Table } from '../../packages/table/lib/table.ts';

const table: Table = new Table(
[ 'Row 1 Column 1', 'Row 1 Column 2', 'Row 1 Column 3' ],
[ 'Row 2 Column 1', 'Row 2 Column 2', 'Row 2 Column 3' ],
[ 'Row 3 Column 1', 'Row 3 Column 2', 'Row 3 Column 3' ]
);

console.log( table.toString() );
// You can also use table.render() as shorthand which uses Deno.stdout.writeSync() under the hood.
15 changes: 15 additions & 0 deletions examples/table/colspan-and-rowspan.ts
@@ -0,0 +1,15 @@
#!/usr/bin/env -S deno run

import { Cell } from '../../packages/table/lib/cell.ts';
import { Table } from '../../packages/table/lib/table.ts';

Table.from( [
[ Cell.from( 'Row 1 & 2 Column 1' ).rowSpan( 2 ), 'Row 1 Column 2', 'Row 1 Column 3' ],
[ Cell.from( 'Row 2 Column 2 & 3' ).colSpan( 2 ) ],
[ Cell.from( 'Row 3 & 4 Column 1' ).rowSpan( 2 ), 'Row 3 Column 2', 'Row 3 Column 3' ],
[ Cell.from( 'Row 4 Column 2 & 3' ).colSpan( 2 ) ],
[ 'Row 5 Column 1', Cell.from( 'Row 5 & 6 Column 2 & 3' ).rowSpan( 2 ).colSpan( 2 ) ],
[ 'Row 6 Column 1' ]
] )
.border( true )
.render();
12 changes: 12 additions & 0 deletions examples/table/header-and-body.ts
@@ -0,0 +1,12 @@
#!/usr/bin/env -S deno run

import { Table } from '../../packages/table/lib/table.ts';

new Table()
.header( [ 'Heading 1', 'Heading 2', 'Heading 3' ] )
.body( [
[ 'Row 1 Column 1', 'Row 1 Column 2', 'Row 1 Column 3' ],
[ 'Row 2 Column 1', 'Row 2 Column 2', 'Row 2 Column 3' ],
[ 'Row 3 Column 1', 'Row 3 Column 2', 'Row 3 Column 3' ]
] )
.render();
12 changes: 0 additions & 12 deletions examples/table/multiline-border-table.ts

This file was deleted.

80 changes: 0 additions & 80 deletions examples/table/multiline-nested-border-table.ts

This file was deleted.

82 changes: 0 additions & 82 deletions examples/table/multiline-nested-table.ts

This file was deleted.

12 changes: 0 additions & 12 deletions examples/table/multiline-table.ts

This file was deleted.

86 changes: 0 additions & 86 deletions examples/table/nested-tables.ts

This file was deleted.

15 changes: 0 additions & 15 deletions examples/table/padding-indent.ts

This file was deleted.

0 comments on commit df18516

Please sign in to comment.