diff --git a/lib/tty/table/orientation/vertical.rb b/lib/tty/table/orientation/vertical.rb index b1d95b2..52b6487 100644 --- a/lib/tty/table/orientation/vertical.rb +++ b/lib/tty/table/orientation/vertical.rb @@ -26,7 +26,7 @@ def slice(table) header = table.header rows_size = table.rows_size - head = header ? header : (0..rows_size).map { |n| (n + 1).to_s } + head = header ? header : (1..table.columns_count).map(&:to_s) (0...rows_size).reduce([]) do |array, index| array + head.zip(table.rows[index]).map { |row| table.to_row(row) }