Sha256: 9632381cec994aab1a82a68c0955d026b67fe97b69e6bfe8f0674d47cf812d19

Contents?: true

Size: 1.07 KB

Versions: 3

Compression:

Stored size: 1.07 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::ManualBuilder::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

3 entries across 3 versions & 1 rubygems

Version Path
prawn-table-continued-1.0.0.rc3 manual/table/cell_borders_and_bg.rb
prawn-table-continued-1.0.0.rc2 manual/table/cell_borders_and_bg.rb
prawn-table-continued-1.0.0.rc1 manual/table/cell_borders_and_bg.rb