w:docGrid (Document Grid)

Configures the document grid for CJK character alignment and line pitch.

Parent elements

Description

w:docGrid defines the document grid, which snaps characters and line spacing to a regular grid for CJK (Chinese, Japanese, Korean) typography or precise grid layouts. It is defined in ECMA-376 Part 1 §17.6.5.

The grid only affects visual rendering and character alignment; it does not change the stored spacing values. Western-language documents often omit this element or set w:type="default".

Attributes

Attribute Type Possible Values Description
w:type ST_DocGrid default (no grid), lines (line grid only), linesAndChars (line + character grid), snapToChars (character grid, no line grid) Controls what the grid snaps to.
w:linePitch xsd:integer Integer in hundredths of a point (e.g. 2079 = 14.7 pt). Height of one grid line unit.
w:charSpace xsd:integer Integer representing the grid character pitch adjustment. Character grid pitch (used with linesAndChars / snapToChars).

Examples

<!-- Default (no CJK grid) -->
<w:docGrid w:type="default" w:linePitch="360"/>