TabStops
paper-docx 0.2.0 API reference
A sequence of TabStop objects providing access to the tab stops of a paragraph
or paragraph style.
Supports iteration, indexed access, del, and len(). It is accesed using the
:attr:~.ParagraphFormat.tab_stops property of ParagraphFormat; it is not intended
to be constructed directly.
TabStops(element)Attributes
element
attributeelementThe lxml element proxied by this object.
part
attributepartXmlPartThe package part containing this object.
Functions
__delitem__
func__delitem__(idx)Remove the tab at offset idx in this sequence.
paramidx__getitem__
func__getitem__(idx)Enables list-style access by index.
paramidx__iter__
func__iter__()Generate a TabStop object for each of the w:tab elements, in XML document order.
__len__
func__len__()add_tab_stop
funcadd_tab_stop(position, alignment=WD_TAB_ALIGNMENT.LEFT, leader=WD_TAB_LEADER.SPACES)Add a new tab stop at position, a Length object specifying the location
of the tab stop relative to the paragraph edge.
A negative position value is valid and appears in hanging indentation. Tab
alignment defaults to left, but may be specified by passing a member of the
:ref:WdTabAlignment enumeration as alignment. An optional leader character
can be specified by passing a member of the :ref:WdTabLeader enumeration as
leader.
parampositionparamalignment= WD_TAB_ALIGNMENT.LEFTparamleader= WD_TAB_LEADER.SPACESclear_all
funcclear_all()Remove all custom tab stops.