From 34360d81564580f7890c72d103d51b5296c73df3 Mon Sep 17 00:00:00 2001 From: Paulo Gorgita Date: Wed, 17 Mar 2021 12:08:00 +0100 Subject: [PATCH] fixes piotrmurach/tty-table/issues/35 --- lib/tty/table/orientation/vertical.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) }