w:sectPr (Section Properties)

Defines layout properties for a document section (page size, margins, headers, footers, columns).

Description

w:sectPr contains all section-level layout properties for one section of the document. It is defined in ECMA-376 Part 1 §17.6.17.

A document has one section per w:sectPr. The final section’s w:sectPr is a direct child of w:body; other section breaks are stored inside the w:pPr of the last paragraph in the preceding section. Section properties control page size, margins, columns, headers/footers, page numbering, page borders, and document grid settings.

Sections allow different page layouts within a single document—for example, landscape pages after portrait, different header/footer content per section, or multi-column regions.

Attributes

Attribute Type Possible Values Description
w:rsidR ST_LongHexNumber 8-digit hex Revision identifier for element insertion (informational).
w:rsidSect ST_LongHexNumber 8-digit hex Revision identifier for section formatting changes (informational).
w:rsidDel ST_LongHexNumber 8-digit hex Revision identifier for element deletion (informational).
w:rsidRPr ST_LongHexNumber 8-digit hex Revision identifier for section properties change (informational).

Common Child Elements

Child Purpose Example
w:pgSz Page size (width, height, orientation) <w:pgSz w:w="12240" w:h="15840" w:orient="portrait"/>
w:pgMar Page margins (top, right, bottom, left, header, footer, gutter) <w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440"/>
w:cols Column layout (single, multi, balanced, separator) <w:cols w:num="2" w:sep="false"/>
w:headerReference Reference to header part (type=default, first, even) <w:headerReference w:type="default" r:id="rId1"/>
w:footerReference Reference to footer part (type=default, first, even) <w:footerReference w:type="default" r:id="rId2"/>
w:titlePg First page uses different header/footer <w:titlePg/>
w:evenAndOddHeaders Different headers for even and odd pages <w:evenAndOddHeaders/>
w:pgNumType Page number restart settings <w:pgNumType w:fmt="decimal" w:start="1"/>
w:pgBorders Borders around page margins <w:pgBorders w:offsetFrom="page">...</w:pgBorders>

Examples

Standard single-section page (Letter, 1-inch margins)

<w:sectPr>
  <w:pgSz w:w="12240" w:h="15840" w:orient="portrait"/>
  <w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440"
           w:header="720" w:footer="720" w:gutter="0"/>
  <w:docGrid w:linePitch="360"/>
</w:sectPr>

Two-column section with landscape orientation

<w:sectPr>
  <w:pgSz w:w="15840" w:h="12240" w:orient="landscape"/>
  <w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440"
           w:header="720" w:footer="720" w:gutter="0"/>
  <w:cols w:num="2" w:sep="false" w:space="720"/>
  <w:headerReference w:type="default" r:id="rId1"/>
  <w:footerReference w:type="default" r:id="rId2"/>
</w:sectPr>

Section with different first page and page numbering restart

<w:sectPr>
  <w:pgSz w:w="12240" w:h="15840"/>
  <w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440"
           w:header="720" w:footer="720" w:gutter="0"/>
  <w:headerReference w:type="default" r:id="rId1"/>
  <w:headerReference w:type="first" r:id="rId3"/>
  <w:footerReference w:type="default" r:id="rId2"/>
  <w:titlePg/>
  <w:pgNumType w:fmt="decimal" w:start="1"/>
</w:sectPr>

Standard Page Sizes (Letter/A4)

Size Width Height Twips Width Twips Height
Letter (8.5×11 in) 8.5” 11” 12240 15840
A4 (210×297 mm) 8.27” 11.69” 11906 16838
Landscape Letter 11” 8.5” 15840 12240
A5 (half A4) 5.83” 8.27” 8391 11906

Standard Margin Presets

Type Top Right Bottom Left Use Case
Normal 1440 1440 1440 1440 Standard 1-inch margins
Narrow 720 720 720 720 Space-saving 0.5-inch margins
Wide 2160 2160 2160 2160 1.5-inch margins for comments
Mirror L:1440, R:1080 — 1440 — Book-style facing pages

All Child Elements

Element Purpose Frequency Details
w:pgSz Page dimensions and orientation Required (1) Width, height, orientation (portrait/landscape)
w:pgMar Page margins and header/footer distance Required (1) Top, right, bottom, left, header, footer, gutter
w:cols Column layout configuration Optional Number of columns, balancing, separator lines
w:headerReference Reference to header part Optional (0–3) One each for default, first, even; via relationship ID
w:footerReference Reference to footer part Optional (0–3) One each for default, first, even; via relationship ID
w:titlePg Use different first-page header/footer Optional (1) Empty element; presence enables feature
w:evenAndOddHeaders Use different headers for even/odd pages Optional (1) Empty element; must have headerReference type=”even”
w:pgNumType Page numbering format and restart Optional (1) Number format (decimal, roman, letters), start value
w:pgBorders Page border definition Optional (1) Four borders around page with style, color, width
w:docGrid Document grid (line spacing snap) Optional (1) Line pitch for aligning text to grid

Key Concepts

Units and Measurements

  • Twips: Most measurements use twips (1/20 of a point); 1 inch = 1440 twips, 1 cm ≈ 567 twips
  • Orientation: portrait (default) or landscape; affects page width/height rendering

Headers/Footers

  • Three Types: default (all pages), first (title page), even (even pages in mirror mode)
  • TitlePg Element: If present, first page uses type="first" header; otherwise uses type="default"
  • EvenAndOddHeaders: Requires separate type="even" header; odd pages use default

Section Breaks

  • Last Section: Lives in w:body as direct child
  • Intermediate Sections: Embedded in w:pPr of last paragraph in section; marks transition to next section
  • Impact: Page properties (size, margins, columns, headers) apply from section break to next break (or document end)

Margins vs. Gutter

  • Margins: Physical space from page edge (top, right, bottom, left)
  • Gutter: Additional space on binding side (left in normal, alternates in mirror mode)
  • Header/Footer Distance: Space between page edge and header/footer content baseline

Multi-Column Layouts

  • w:cols activates; default is num="1"
  • Balanced Columns: All columns equal height (text flows down first column, then next)
  • Separator Line: sep="true" adds vertical line between columns
  • Column Spacing: space attribute defines gap width

Page Numbering

  • Format: decimal, upperRoman, lowerRoman, upperLetter, lowerLetter
  • Start: Restart page numbering at section boundary; omit to continue from previous
  • Reset Fields: Fields like { PAGE } display page number relative to section start

Notes

  • Section breaks: A section break at a paragraph boundary creates a new w:sectPr inside the w:pPr of that paragraph; the old section’s w:sectPr is replaced.
  • Page size units: Width and height are in twips; 1 inch = 1440 twips, 1 cm ≈ 567 twips.
  • Header/footer distance: The header and footer attributes define distance from page edge to header/footer content; measured in twips.
  • Gutter: Extra margin added to left (or inside in mirror mode) for binding space.
  • Columns: Use w:cols for multi-column layouts; columns are balanced (equal height) by default unless using continuous columns.
  • Page borders: Define borders around the entire page margin; offsetFrom="page" (from page edge) or offsetFrom="text" (from text boundary).
  • Revision IDs: The rsid* attributes track which revision session modified section properties; for informational purposes only.
  • Consistency: All sections define complete w:sectPr; Office fills in defaults for missing children (e.g., default margins if w:pgMar omitted).
  • Performance: Complex multi-section documents with many headers/footers may increase file size; use shared headers/footers where possible.
  • Accessibility: Different headers/footers must include logical structure; use bookmarks or sectioning for clarity.