0.0
Low commit activity in last 3 years
No release in over a year
table-formatter prints a table in plain text format or Markdown format from an array
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.2.0, ~> 0.2
~> 2.2, >= 2.2.0.1
 Project Readme

#Introducing the Table-formatter gem

sudo gem1.9.1 install table-formatter
require 'table-formatter'
labels = %w(Name Age Address Code)
a = [['Bob', '20', '10, High Street','A342'],
     ['Jane', '23', '12/3, Lawn Market Court', 'B34F'],
     ['Bruce', '32', '63, Cotswalds Way', 'F34AD'],
     ['Michael', '49', '1, Hollwood Way', 'E234D'],
     ['Stephanie', '34', '2, Hampton Court','A234']]

tfo = TableFormatter.new
tfo.source = a
tfo.labels = labels
puts tfo.display

output

--------------------------------------------------------
| Name       | Age | Address                  | Code   |
--------------------------------------------------------
| Bob        | 20  | 10, High Street          | A342   |
| Jane       | 23  | 12/3, Lawn Market Court  | B34F   |
| Bruce      | 32  | 63, Cotswalds Way        | F34AD  |
| Michael    | 49  | 1, Hollwood Way          | E234D  |
| Stephanie  | 34  | 2, Hampton Court         | A234   |
--------------------------------------------------------