Skip to content

Page break logic only checks the first column #155

@vanboom

Description

@vanboom

Consider a table where the first column has an index number, with multi-line text in the subsequent columns.

E.g.

index title description
1. A short title Some very long multi-line text....

The start_new_page? method only checks the first column in a row to see if it fits on the page...

(cell.column == 0 && cell.row > 0 &&

If one of the other cells wraps to multi-line at the end of a page, a new page will not result.

Suggestion: consider removing the cell.column == 0 check so that the row will start a new page if any of the row content will not fit on the current page.

    # OLD WAY - check only column 0
      # (cell.column == 0 && cell.row > 0 &&
      #  !row(cell.row).fits_on_current_page?(offset, ref_bounds))

      # NEW WAY - check all columns
      (cell.row > 0 &&
      !row(cell.row).fits_on_current_page?(offset, ref_bounds))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions