From cabce3b86622b3e9ab95b9cf47598585c1220861 Mon Sep 17 00:00:00 2001 From: Paulo Gorgita Date: Fri, 19 Mar 2021 09:31:16 +0100 Subject: [PATCH] fixes piotrmurach/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) }