File: strong_separator.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 (23 lines) | stat: -rwxr-xr-x 494 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
#!/usr/bin/env ruby
require_relative "../lib/terminal-table"

#
# An example of how to manually add separators with non-default
# border_type to enable a footer row.
#
table = Terminal::Table.new do |t|
  # set the style
  t.style = { border: :unicode_thick_edge }
  
  # header row
  t.headings = ['fruit', 'count']

  # some row data
  t.add_row ['apples', 7]
  t.add_row ['bananas', 19]
  t.add_separator border_type: :strong
  # footer row
  t.add_row ['total', 26] 
end

puts table.render