Sha256: 5235bb3571c406a6a87affae56389705e678faf4bc8b97993e952ce0b229be0d

Contents?: true

Size: 494 Bytes

Versions: 76

Compression:

Stored size: 494 Bytes

Contents

#!/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

Version data entries

76 entries across 76 versions & 3 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.2.10 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.2.9 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.2.8 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.2.7 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.2.6 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.2.5 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.2.4 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.2.3 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.2.2 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.2.1 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.2.0 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.1.99 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.1.98 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.1.97 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.1.96 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.1.95 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.1.94 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb
harbr-0.1.93 vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/examples/strong_separator.rb