Sha256: 7311246dc502d6f48c02d3004343d6a3070b3ca3814dd02e4f804316c58115c5

Contents?: true

Size: 1.04 KB

Versions: 8

Compression:

Stored size: 1.04 KB

Contents

# encoding: utf-8
#
# The <code>borders</code> option accepts an array with the border sides that
# will be drawn. The default is <code>[:top, :bottom, :left, :right]</code>.
#
# <code>border_width</code> may be set with a numeric value.
#
# Both <code>border_color</code> and <code>background_color</code> accept an
# HTML like RGB color string ("FF0000")
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::Example.generate(filename) do
  data = [ ["Look at how the cells will look when styled", "", ""],
           ["They probably won't look the same", "", ""]
         ]
  
  { :borders => [:top, :left],
    :border_width => 3,
    :border_color => "FF0000"}.each do |property, value|
      
      text "Cell #{property}: #{value.inspect}"
      table(data, :cell_style => {property => value})
      move_down 20
  end
  
  text "Cell background_color: FFFFCC"
  table(data, :cell_style => {:background_color => "FFFFCC"})
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
prawn-1.0.0 manual/table/cell_borders_and_bg.rb
prawn-0.15.0 manual/table/cell_borders_and_bg.rb
prawn-0.14.0 manual/table/cell_borders_and_bg.rb
prawn-0.13.2 manual/table/cell_borders_and_bg.rb
prawn-0.13.1 manual/table/cell_borders_and_bg.rb
prawn-0.13.0 manual/table/cell_borders_and_bg.rb
prawn-1.0.0.rc2 manual/table/cell_borders_and_bg.rb
nurettin-prawn-1.0.0.rc1 manual/table/cell_borders_and_bg.rb