File: table_ignores_align_headers.rb

package info (click to toggle)
ruby-prawn 1.0.0~rc1%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,248 kB
  • sloc: ruby: 17,499; sh: 44; makefile: 17
file content (28 lines) | stat: -rw-r--r-- 979 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# As of fadb65c303ff129d0b25a929d3b9d1f915b2f98d,
# Prawn ignores :align_headers property in tables
# when :border_style => :grid is present (Lighthouse issue #119).
#
# NOTES: 
# 
#  * This issue can only be reproduced when :border_style => :grid is used
#
# Resolved as of 47297900dcf3f16c4765ca817f17c53fb0a5a079
# I think a bad merge created issues in edge, and this code fixes previous
# problems that are present in stable.
#
$DEBUG = true

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')
require "rubygems"
require "prawn"
require "prawn/layout"

Prawn::Document.generate("table_ignores_align_headers.pdf") do
  left  = "Left justified"
  left2 = "left"
  center = "centered"
  table [[left, left], [left2, left2]], :headers       => [center, center], 
                                      :align         => :left, 
                                      :align_headers => :center,
                                      :border_style  => :grid
end