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

Method insert_tab_in_order

src/docx/oxml/text/parfmt.py:383–392  ·  view source on GitHub ↗

Insert a newly created `w:tab` child element in `pos` order.

(self, pos, align, leader)

Source from the content-addressed store, hash-verified

381 tab = OneOrMore("w:tab", successors=())
382
383 def insert_tab_in_order(self, pos, align, leader):
384 """Insert a newly created `w:tab` child element in `pos` order."""
385 new_tab = self._new_tab()
386 new_tab.pos, new_tab.val, new_tab.leader = pos, align, leader
387 for tab in self.tab_lst:
388 if new_tab.pos < tab.pos:
389 tab.addprevious(new_tab)
390 return new_tab
391 self.append(new_tab)
392 return new_tab

Callers 2

add_tab_stopMethod · 0.80
positionMethod · 0.80

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected