File: issue100.rb

package info (click to toggle)
ruby-terminal-table 4.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 232 kB
  • sloc: ruby: 875; makefile: 3
file content (34 lines) | stat: -rwxr-xr-x 710 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env ruby

# Methods to suppress left/right borders using border_left & border_right

require_relative "../lib/terminal-table"
table = Terminal::Table.new do |t|
  t.headings = ['id', 'name']
  t.rows = [[1, 'One'], [2, 'Two'], [3, 'Three']]
  t.style = { :border_left => false, :border_top => false, :border_bottom => false }
end

puts table
puts

# no right
table.style = {:border_right => false }
puts table
puts

# no right
table.style = {:border_left => true }
puts table
puts

table.style.border = Terminal::Table::UnicodeBorder.new
puts table


table.style = {:border_right => false, :border_left => true }
puts table

table.style = {:border_right => true, :border_left => false }
puts table