RTables (Ruby Tables) is a small library that helps you generate table output in various predefined formats.
To install RTables, you can either git clone
the GitHub repository, or simply run gem install rtables
require 'rtables'
# Initialize the table you wish to use.
table = RTables::Table::PlainTable.new
# Add the table headers to the table. This will structure our table.
table.add_column('Example')
table.add_column('Second Column')
# Start adding rows to the table.
# For each column you have added, you need to pass another parameter.
table.add_row('Hello', 'World!')
table.add_row('Another day', 'Another row!')
table.add_row('It\'s a beautiful day to be a table', 'Indeed.')
# The final step, we either .render or .to_s our table.
# .render returns a line-separated array,
# .to_s calls render.join("\n").
puts table.to_s
Tables are nice, but each table has their positive and negative things.
The documentation explains the cons and pros of each table.
There are two primary means of support.
- Leave an issue on the GitHub Repository
- Alternatively, you may ask your question through IRC on EsperNet in #zarthus
To allow us to help you, we suggest you seek out the documentation and contributing files first.
RTables is licensed under the MIT license