Skip to content

API reference / Common / Engine types / GridCellAlignment

Interface: GridCellAlignment ​

A cell's alignment — styleSheet/cellXfs/xf/alignment (CT_CellAlignment, §18.8.1), and the same under styleSheet/cellStyleXfs/xf and styleSheet/dxfs/dxf. The paths below are given under styleSheet/cellXfs/xf/alignment.

Every attribute is an Option, None when absent — including @vertical, whose schema default is bottom: a differential format that leaves it unset must not reset the cell's.

Properties ​

PropertyDescription
horizontal?
GridHorizontalAlignment
styleSheet/cellXfs/xf/alignment/@horizontal — Office takes general when absent (MS-OI29500 §2.1.693).
vertical?
GridVerticalAlignment
styleSheet/cellXfs/xf/alignment/@vertical — the schema's default, and Office's, is bottom.
wrapText?
boolean
styleSheet/cellXfs/xf/alignment/@wrapText — the text wraps within the cell's width.
shrinkToFit?
boolean
styleSheet/cellXfs/xf/alignment/@shrinkToFit — the text shrinks to fit the cell's width; "not applicable when a cell contains multiple lines of text" (§18.8.1).
indent?
number
styleSheet/cellXfs/xf/alignment/@indent — in steps of three spaces of the Normal style's font (§18.8.1); 255 at most (MS-OI29500 §2.1.693).
relativeIndent?
number
styleSheet/cellXfs/xf/alignment/@relativeIndent — indent added to the cell's, "used only in a dxf element" (§18.8.1).
textRotation?
number
styleSheet/cellXfs/xf/alignment/@textRotation — 0 to 90 degrees up from the horizon; 91 to 180, 90 - n degrees down; 255, stacked vertical text (MS-OI29500 §2.1.693).
readingOrder?
number
styleSheet/cellXfs/xf/alignment/@readingOrder — 0 by the text's first strong character, 1 left-to-right, 2 right-to-left.
justifyLastLine?
boolean
styleSheet/cellXfs/xf/alignment/@justifyLastLine — a justified or distributed cell spreads its last line too.