public
Description: Fast, Nimble PDF Writer for Ruby
Homepage: http://prawn.majesticseacreature.com
Clone URL: git://github.com/sandal/prawn.git
Integrating patch from Brian Kenn
Per ticket #98:
allows proper alignment of table headers
cbartlett (author)
Thu Nov 06 19:43:51 -0800 2008
sandal (committer)
Fri Nov 14 06:44:09 -0800 2008
commit  47297900dcf3f16c4765ca817f17c53fb0a5a079
tree    92632ad3a643680114a02278684e27ceb13bbfb1
parent  786146a2583d3e51f7b6dc804b94e93b9bbef2d0
...
268
269
270
271
272
273
274
275
276
 
 
 
 
 
 
 
 
 
 
 
 
 
277
278
279
...
268
269
270
 
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
0
@@ -268,12 +268,24 @@ module Prawn
0
         else
0
           if C(:headers)
0
             contents.first.border_style = :all
0
-            contents.first.align = C(:align_headers) || :left
0
           else
0
             contents.first.border_style = :no_bottom
0
           end
0
           contents.last.border_style = :no_top
0
         end
0
+        if C(:headers)
0
+          contents.first.cells.each_with_index do |e,i|
0
+          if C(:align_headers)
0
+            case C(:align_headers)
0
+              when Hash
0
+                align = C(:align_headers)[i]
0
+              else
0
+                align = C(:align_headers)
0
+              end
0
+            end
0
+            e.align = align if align
0
+          end
0
+        end
0
         
0
         contents.first.background_color = C(:header_color) if C(:header_color)
0
  

Comments