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

Class CT_TrPr

src/docx/oxml/table.py:892–961  ·  view source on GitHub ↗

`` `` element, defining table row properties.

Source from the content-addressed store, hash-verified

890
891
892class CT_TrPr(BaseOxmlElement):
893 """``<w:trPr>`` element, defining table row properties."""
894
895 get_or_add_trHeight: Callable[[], CT_Height]
896
897 _tag_seq = (
898 "w:cnfStyle",
899 "w:divId",
900 "w:gridBefore",
901 "w:gridAfter",
902 "w:wBefore",
903 "w:wAfter",
904 "w:cantSplit",
905 "w:trHeight",
906 "w:tblHeader",
907 "w:tblCellSpacing",
908 "w:jc",
909 "w:hidden",
910 "w:ins",
911 "w:del",
912 "w:trPrChange",
913 )
914 gridAfter: CT_DecimalNumber | None = ZeroOrOne( # pyright: ignore[reportAssignmentType]
915 "w:gridAfter", successors=_tag_seq[4:]
916 )
917 gridBefore: CT_DecimalNumber | None = ZeroOrOne( # pyright: ignore[reportAssignmentType]
918 "w:gridBefore", successors=_tag_seq[3:]
919 )
920 trHeight: CT_Height | None = ZeroOrOne( # pyright: ignore[reportAssignmentType]
921 "w:trHeight", successors=_tag_seq[8:]
922 )
923 del _tag_seq
924
925 @property
926 def grid_after(self) -> int:
927 """The number of unpopulated layout-grid cells at the end of this row."""
928 gridAfter = self.gridAfter
929 return 0 if gridAfter is None else gridAfter.val
930
931 @property
932 def grid_before(self) -> int:
933 """The number of unpopulated layout-grid cells at the start of this row."""
934 gridBefore = self.gridBefore
935 return 0 if gridBefore is None else gridBefore.val
936
937 @property
938 def trHeight_hRule(self) -> WD_ROW_HEIGHT_RULE | None:
939 """Return the value of `w:trHeight@w:hRule`, or |None| if not present."""
940 trHeight = self.trHeight
941 return None if trHeight is None else trHeight.hRule
942
943 @trHeight_hRule.setter
944 def trHeight_hRule(self, value: WD_ROW_HEIGHT_RULE | None):
945 if value is None and self.trHeight is None:
946 return
947 trHeight = self.get_or_add_trHeight()
948 trHeight.hRule = value
949

Callers

nothing calls this directly

Calls 1

ZeroOrOneClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…