MCPcopy Index your code
hub / github.com/python-openxml/python-docx / add_tab_stop

Method add_tab_stop

src/docx/text/tabstops.py:53–65  ·  view source on GitHub ↗

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 th

(self, position, alignment=WD_TAB_ALIGNMENT.LEFT, leader=WD_TAB_LEADER.SPACES)

Source from the content-addressed store, hash-verified

51 return len(tabs.tab_lst)
52
53 def add_tab_stop(self, position, alignment=WD_TAB_ALIGNMENT.LEFT, leader=WD_TAB_LEADER.SPACES):
54 """Add a new tab stop at `position`, a |Length| object specifying the location
55 of the tab stop relative to the paragraph edge.
56
57 A negative `position` value is valid and appears in hanging indentation. Tab
58 alignment defaults to left, but may be specified by passing a member of the
59 :ref:`WdTabAlignment` enumeration as `alignment`. An optional leader character
60 can be specified by passing a member of the :ref:`WdTabLeader` enumeration as
61 `leader`.
62 """
63 tabs = self._pPr.get_or_add_tabs()
64 tab = tabs.insert_tab_in_order(position, alignment, leader)
65 return TabStop(tab)
66
67 def clear_all(self):
68 """Remove all custom tab stops."""

Callers 2

when_I_add_a_tab_stopFunction · 0.80
it_can_add_a_tab_stopMethod · 0.80

Calls 2

TabStopClass · 0.85
insert_tab_in_orderMethod · 0.80

Tested by 1

it_can_add_a_tab_stopMethod · 0.64