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

Method merge

src/docx/oxml/table.py:508–517  ·  view source on GitHub ↗

Return top-left `w:tc` element of a new span. Span is formed by merging the rectangular region defined by using this tc element and `other_tc` as diagonal corners.

(self, other_tc: CT_Tc)

Source from the content-addressed store, hash-verified

506 return self.grid_offset
507
508 def merge(self, other_tc: CT_Tc) -> CT_Tc:
509 """Return top-left `w:tc` element of a new span.
510
511 Span is formed by merging the rectangular region defined by using this tc
512 element and `other_tc` as diagonal corners.
513 """
514 top, left, height, width = self._span_dimensions(other_tc)
515 top_tc = self._tbl.tr_lst[top].tc_at_grid_offset(left)
516 top_tc._grow_to(width, height)
517 return top_tc
518
519 @classmethod
520 def new(cls) -> CT_Tc:

Callers

nothing calls this directly

Calls 3

_span_dimensionsMethod · 0.95
tc_at_grid_offsetMethod · 0.80
_grow_toMethod · 0.80

Tested by

no test coverage detected