Skip to content

Add footer rows with shared numeric formatting and column alignment - #514

Open
Aschenbath wants to merge 1 commit into
astanin:masterfrom
Aschenbath:fix/big20-20261123-bde6-tabulate-footer
Open

Aschenbath wants to merge 1 commit into
astanin:masterfrom
Aschenbath:fix/big20-20261123-bde6-tabulate-footer

Conversation

@Aschenbath

Copy link
Copy Markdown

Add footer, a row with one cell per data column, to tabulate(). Footer values participate in numeric formatting, type inference, widths, wrapping and alignment. The footer uses a header-style rule; ruleless formats use a blank line. HTML gets a tfoot section, and LaTeX longtable does not repeat endhead.

Closes #69.

Generated and custom row indices cover body rows only, leaving the footer index blank. Empty bodies and ragged rows are supported. Rendering consumes row alignment only for actual data rows, and an existing trailing separator is replaced by the footer boundary. The argument is appended to the signature, preserving positional callers.

Validation: full tests and doctests pass on Python 3.12 and 3.10 (486 passed, 1 existing skip each); Ruff lint/format pass. Tests cover every built-in format plus a custom format, exact layouts, Decimal precision, ANSI/multiline/wrapped cells, mapped/first-row headers, generators, Pandas indices and HTML/LaTeX structure. Existing output assertions remain unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support for "footer" or "total" row

1 participant