Sha256: f6b7b9617d842d27e8605087e13be6f239c80dddd1bc2364ed2bb74fdcd93d6d

Contents?: true

Size: 689 Bytes

Versions: 6

Compression:

Stored size: 689 Bytes

Contents

# encoding: utf-8
#
# Demonstrates the use of the :col_span option when using Document#table
#
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib'))

require "rubygems"
require "prawn"
require "prawn/layout"

Prawn::Document.generate "table_colspan.pdf" do
  data = [ ['01/01/2008', 'John Doe', '4.2', '125.00', '525.00'], 
           ['01/12/2008', 'Jane Doe', '3.2', '75.50', '241.60'] ] * 5
  
  data << [{:text => 'Total', :colspan => 2}, '37.0', '1002.5', '3833']
  
  table data,
  :position => :center,
  :headers => ['Date', 'Employee', 'Hours', 'Rate', 'Total'],
  :column_widths => { 0 => 75, 1 => 100, 2 => 50, 3 => 50, 4 => 50},
  :border_style => :grid
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
sskirby-prawn-layout-0.1.1 examples/table/table_colspan.rb
prawn-flexible-table-0.1.2 examples/table_colspan.rb
prawn-flexible-table-0.1.1 examples/table_colspan.rb
prawn-flexible-table-0.1 examples/table_colspan.rb
prawn-layout-0.2.0.1 examples/table/table_colspan.rb
prawn-layout-0.1.0 examples/table/table_colspan.rb