lib/prawn/table.rb in prawn-layout-0.2.0.1 vs lib/prawn/table.rb in prawn-layout-0.2.1

- old
+ new

@@ -281,19 +281,25 @@ |sum, width| sum + width } else @column_widths[col_index] end - cell_options = {:document => @document, + cell_options = { + :document => @document, :text => text, :width => width, :horizontal_padding => C(:horizontal_padding), :vertical_padding => C(:vertical_padding), :border_width => C(:border_width), :border_style => :sides, - :align => align} - cell_options[:font_style] = e[:font_style] if e.is_a?(Hash) && e.has_key?(:font_style) - cell_options[:font_size] = e[:font_size] if e.is_a?(Hash) && e.has_key?(:font_size) + :align => align + } + + if e.is_a?(Hash) + opts = e.dup + opts.delete(:colspan) + cell_options.update(opts) + end c << Prawn::Table::Cell.new(cell_options) end col_index += (e.is_a?(Hash) && e.has_key?(:colspan)) ? e[:colspan] : 1