visionmedia/terminal-table — Issue #19: Setting title breaks first column width
Author: viking
Created: 2012-02-28 16:13:05+00:00
State: open

Setting the table title incorrectly changes the first column's width:

require 'rubygems'
require 'terminal-table'

table = Terminal::Table.new do |t|
t.title = "This is a title"
t.headings = %w{foo bar baz}
t << %w{foo bar baz}
end
puts table

table = Terminal::Table.new do |t|
t.headings = %w{foo bar baz}
t << %w{foo bar baz}
end
puts table

Output:

+-----------------+-----+-----+
| This is a title |
+-----------------+-----+-----+
| foo | bar | baz |
+-----------------+-----+-----+
| foo | bar | baz |
+-----------------+-----+-----+
+-----+-----+-----+
| foo | bar | baz |
+-----+-----+-----+
| foo | bar | baz |
+-----+-----+-----+