-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Repeatable Table Footers [More Flexible Tables Pt.6a] #3577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
based on header tests
- If they have a gutter in common, the header wins and keeps that gutter row - Only check for conflict after applying gutter modifications
Of note, a larger refactor is likely in order, moving |
I minified the test images a bit. Thank you for the PR! |
Adds
table.footer
andgrid.footer
to have some rows repeat at the bottom of a table's pages.First part of the sixth task in #3001.
Currently, footers must always include the last row of the table.
NOTE: There are some parts of this PR which are direct improvements/fixes for headers, such as the
Repeatable
enum, which is used to force non-repeated headers to be unbreakable for consistency. If needed for the release, I can try to extract as much as possible into a separate PR, but, ideally, we'd just merge this PR, which, as I see it, is basically ready. :)User-facing API
table.footer
andgrid.footer
withrepeat: true/false
(defaults totrue
) to have optionally repeatable footer rows at the bottom of the table. When there's gutter, the gutter above the footer is repeated too.Implementation details
self.regions.map
, usein_last_with_offset
etc. This is made possible by the fact that I simulate the footers right before simulating headers, and then skip regions until both header and footer fit. The simulated footer height is kept in the layouter state so rows can be aware of that info, but either way it is subtracted from the available size so rows will properly skip to the next region as needed.finish_region
is called, right before effectively resolving rows inlrows
, and it only occurs if it hasn't been laid out already, or if it wouldn't be an orphan (and/or the region would only have the header and the footer, in which case both would be orphans and would not be laid out).