File: cell_border_lines.rb

package info (click to toggle)
ruby-prawn-table 0.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 532 kB
  • sloc: ruby: 3,355; makefile: 5
file content (24 lines) | stat: -rw-r--r-- 884 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# encoding: utf-8
#
# The <code>border_lines</code> option accepts an array with the styles of the
# border sides. The default is <code>[:solid, :solid, :solid, :solid]</code>.
#
# <code>border_lines</code> must be set to an array.
#
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 cell border lines can be mixed", "", ""],
            ["dotted top border", "", ""],
            ["solid right border", "", ""],
            ["dotted bottom border", "", ""],
            ["dashed left border", "", ""]
          ]

  text "Cell :border_lines => [:dotted, :solid, :dotted, :dashed]"

  table(data, :cell_style =>
    { :border_lines => [:dotted, :solid, :dotted, :dashed] })
end