I have a variable number of tables with variable number of rows and I want to have them displaying one after the other but if a table doesn\'t fit on the current page put it on
@current_page = pdf.page_count
@roll = pdf.transaction do
pdf.move_down 20
pdf.table @data,
:font_size => 12,
:border_style => :grid,
:horizontal_padding => 10,
:vertical_padding => 3,
:border_width => 2,
:position => :left,
:row_colors => ["FFFFFF","DDDDDD"]
pdf.rollback if pdf.page_count > @current_page
end
if @roll == false
pdf.start_new_page
pdf.table @data,
:font_size => 12,
:border_style => :grid,
:horizontal_padding => 10,
:vertical_padding => 3,
:border_width => 2,
:position => :left,
:row_colors => ["FFFFFF","DDDDDD"]
end
I hope this works for you as for me :-)