Sha256: 33b6eba3971fc65aeeafdb88827c75ebe7519d2d97daf4c7814a620c8bbfe3a4

Contents?: true

Size: 1.04 KB

Versions: 11

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::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

11 entries across 11 versions & 2 rubygems

Version Path
prawn-table-0.2.2 manual/table/cell_borders_and_bg.rb
prawn-table-0.2.1 manual/table/cell_borders_and_bg.rb
prawn-table-0.2.0 manual/table/cell_borders_and_bg.rb
prawn-table-0.1.2 manual/table/cell_borders_and_bg.rb
prawn-table-0.1.1 manual/table/cell_borders_and_bg.rb
prawn-table-0.1.0 manual/table/cell_borders_and_bg.rb
prawn-table-0.0.4 manual/table/cell_borders_and_bg.rb
prawn-table-0.0.3 manual/table/cell_borders_and_bg.rb
prawn-table-0.0.2 manual/table/cell_borders_and_bg.rb
prawn-table-0.0.1 manual/table/cell_borders_and_bg.rb
prawn-1.1.0 manual/table/cell_borders_and_bg.rb