--- table.rb 2009-09-28 17:11:02.234375000 +0200
+++ table_mine.rb 2009-09-28 17:15:42.093750000 +0200
@@ -102,7 +102,7 @@
# :border_width:: With of border lines in PDF points [1]
# :border_style:: If set to :grid, fills in all borders. If set to :underline_header, underline header only. Otherwise, borders are drawn on columns only, not rows
# :border_color:: Sets the color of the borders.
- # :position:: One of :left, :center or n, where n is an x-offset from the left edge of the current bounding box
+ # :position:: One of :left, :center, :right or n, where n is an x-offset from the left edge of the current bounding box
# :width: A set width for the table, defaults to the sum of all column widths
# :column_widths: A hash of indices and widths in PDF points. E.g. { 0 => 50, 1 => 100 }
# :row_colors:: An array of row background colors which are used cyclicly.
@@ -168,6 +168,13 @@
@document.move_down(dy)
generate_table
end
+ when :right # Added by PHI september 2009
+ x = @document.bounds.width - width
+ dy = @document.bounds.absolute_top - @document.y
+ @document.bounding_box [x, @parent_bounds.top], :width => width do
+ @document.move_down(dy)
+ generate_table
+ end
when Numeric
x, y = C(:position), @document.y - @document.bounds.absolute_bottom
@document.bounding_box([x,y], :width => width) { generate_table }