WD_PARAGRAPH_ALIGNMENT
paper-docx 0.2.0 API reference
Alias: WD_ALIGN_PARAGRAPH
Specifies paragraph justification type.
Example::
from docx.enum.text import WD_ALIGN_PARAGRAPH
paragraph = document.add_paragraph() paragraph.alignment = WD_ALIGN_PARAGRAPH.CENTER
Attributes
CENTER
attributeCENTER= (1, 'center', 'Center-aligned.')Center-aligned.
DISTRIBUTE
attributeDISTRIBUTE= (4, 'distribute', 'Paragraph characters are distributed to fill entire width of paragraph.')Paragraph characters are distributed to fill entire width of paragraph.
JUSTIFY
attributeJUSTIFY= (3, 'both', 'Fully justified.')Fully justified.
JUSTIFY_HI
attributeJUSTIFY_HI= (7, 'highKashida', 'Justified with a high character compression ratio.')Justified with a high character compression ratio.
JUSTIFY_LOW
attributeJUSTIFY_LOW= (8, 'lowKashida', 'Justified with a low character compression ratio.')Justified with a low character compression ratio.
JUSTIFY_MED
attributeJUSTIFY_MED= (5, 'mediumKashida', 'Justified with a medium character compression ratio.')Justified with a medium character compression ratio.
LEFT
attributeLEFT= (0, 'left', 'Left-aligned')Left-aligned
RIGHT
attributeRIGHT= (2, 'right', 'Right-aligned.')Right-aligned.
THAI_JUSTIFY
attributeTHAI_JUSTIFY= (9, 'thaiDistribute', 'Justified according to Thai formatting layout.')Justified according to Thai formatting layout.
xml_value
attributexml_valuestr | NoneFunctions
from_xml
funcfrom_xml(xml_value: str | None) -> SelfEnumeration member corresponding to XML attribute value xml_value.
Example::
WD_PARAGRAPH_ALIGNMENT.from_xml("center") WD_PARAGRAPH_ALIGNMENT.CENTER
paramxml_valuestr | NoneReturns
typing_extensions.Selfto_xml
functo_xml(value: int | _T | None) -> str | NoneXML value of this enum member, generally an XML attribute value.
paramvalueint | _T | NoneReturns
str | None