Skip to content

Commit 8d85353

Browse files
ankanekojix2
authored andcommitted
Show last row and last column with table method and maxrows and maxcols
1 parent 770aac9 commit 8d85353

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/iruby/formatter.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,16 @@ def table(obj, maxrows: 15, maxcols: 15, **options)
7878

7979
if maxcols && keys.size > maxcols
8080
keys1 = keys[0...maxcols / 2]
81-
keys2 = keys[-maxcols / 2...-1]
81+
keys2 = keys[-maxcols / 2 + 1..-1]
8282
if header
8383
header1 = header[0...maxcols / 2]
84-
header2 = header[-maxcols / 2...-1]
84+
header2 = header[-maxcols / 2 + 1..-1]
8585
end
8686
end
8787

8888
if maxrows && rows.size > maxrows
8989
rows1 = rows[0...maxrows / 2]
90-
rows2 = rows[-maxrows / 2...-1]
90+
rows2 = rows[-maxrows / 2 + 1..-1]
9191
end
9292

9393
table = '<table>'

0 commit comments

Comments
 (0)