Skip to content

Customize Page and TableCell Margins - #3

Open
bdkjones wants to merge 2 commits into
Techopolis:masterfrom
bdkjones:feature/pageMargins
Open

Customize Page and TableCell Margins#3
bdkjones wants to merge 2 commits into
Techopolis:masterfrom
bdkjones:feature/pageMargins

Conversation

@bdkjones

@bdkjones bdkjones commented Aug 3, 2026

Copy link
Copy Markdown

Adds support for specifying margins for both pages and cells in a Table.

  • Page margins default to 1" (72 points) with header/footer set to 0.5", which is Word's default. No breaking changes; these were the hardcoded values in previous versions of SwiftDocX. Page margins are not optional because they must be set for every Document.
  • Margins for table cells can be set on the Table itself, which applies to every cell, and/or on specific TableCell instances, which allows certain cells to have different margins. Margins for tables and cells are optional; if nil Word will apply defaults.

I followed the apparent style conventions in the codebase and this PR replaces my earlier one. I was originally going to make these two separate PRs, but they now share a common Margins type so it made more sense to roll them into one.

Add support for customizing document page size and margins
Support specifying margins for all and/or specific cells in a table.
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.

1 participant