class Prawn::Table

def start_new_page?(cell, offset, ref_bounds)

should we start a new page? (does the current row fail to fit on this page)
def start_new_page?(cell, offset, ref_bounds)
  # we only need to run this test on the first cell in a row
  # check if the rows height fails to fit on the page
  # check if the row is not the first on that page (wouldn't make sense to go to next page in this case)
  (cell.column == 0 && cell.row > 0 &&
   !row(cell.row).fits_on_current_page?(offset, ref_bounds))
end