Skip to content

Commit

Permalink
Add examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Feb 27, 2017
1 parent 8480578 commit 6bb6f77
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/alignment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# encoding: utf-8

require 'tty-table'

table = TTY::Table.new header: ['header1', 'header2', 'header3']
table << ['a1', 'a2', 'a3']
table << ['b1','b2', 'b3']
table << ['c1', 'c2', 'c3']

puts table.render(:ascii, alignments: [:right, :center, :left])
6 changes: 6 additions & 0 deletions examples/basic.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# encoding: utf-8

require 'tty-table'

table = TTY::Table.new ['header1','header2'], [['a1', 'a2'], ['b1', 'b2']]
puts table.render(:basic)

0 comments on commit 6bb6f77

Please sign in to comment.