CT_TcPr
paper-docx 0.2.0 API reference
<w:tcPr> element, defining table cell properties.
Attributes
get_or_add_gridSpan
attributeget_or_add_gridSpanCallable[[], CT_DecimalNumber]get_or_add_tcW
attributeget_or_add_tcWCallable[[], CT_TblWidth]get_or_add_vAlign
attributeget_or_add_vAlignCallable[[], CT_VerticalJc]gridSpan
attributegridSpanCT_DecimalNumber | None= ZeroOrOne('w:gridSpan', successors=(_tag_seq[3:]))grid_span
attributegrid_spanintThe integer number of columns this cell spans.
Determined by ./w:gridSpan/@val, it defaults to 1.
tcW
attributetcWCT_TblWidth | None= ZeroOrOne('w:tcW', successors=(_tag_seq[2:]))vAlign
attributevAlignCT_VerticalJc | None= ZeroOrOne('w:vAlign', successors=(_tag_seq[12:]))vAlign_val
attributevAlign_valValue of w:val attribute on w:vAlign child.
Value is None if w:vAlign child is not present. The w:val attribute on
w:vAlign is required.
vMerge
attributevMergeCT_VMerge | None= ZeroOrOne('w:vMerge', successors=(_tag_seq[5:]))vMerge_val
attributevMerge_valThe value of the ./w:vMerge/@val attribute, or None if the w:vMerge element
is not present.
width
attributewidthLength | NoneEMU length in ./w:tcW or None if not present or its type is not 'dxa'.
xml
attributexmlstrXML string for this element, suitable for testing purposes.
Pretty printed for readability and without an XML declaration at the top.
Functions
first_child_found_in
funcfirst_child_found_in(*tagnames: str) -> _Element | NoneFirst child with tag in tagnames, or None if not found.
paramtagnamesstr= ()Returns
lxml.etree._Element | Noneinsert_element_before
funcinsert_element_before(elm: ElementBase, *tagnames: str)paramelmElementBaseparamtagnamesstr= ()remove_all
funcremove_all(*tagnames: str) -> NoneRemove child elements with tagname (e.g. "a:p") in tagnames.
paramtagnamesstr= ()Returns
Nonexpath
funcxpath(xpath_str: str) -> AnyOverride of lxml _Element.xpath() method.
Provides standard Open XML namespace mapping (nsmap) in centralized location.
paramxpath_strstrReturns
typing.Any