Paper Office
paper-docxAPI referenceoxml.table

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_spanint

The 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_val

Value 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_val

The value of the ./w:vMerge/@val attribute, or None if the w:vMerge element is not present.

width

attributewidthLength | None

EMU length in ./w:tcW or None if not present or its type is not 'dxa'.

xml

attributexmlstr

XML 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 | None

First child with tag in tagnames, or None if not found.

paramtagnamesstr
= ()

Returns

lxml.etree._Element | None

insert_element_before

funcinsert_element_before(elm: ElementBase, *tagnames: str)
paramelmElementBase
paramtagnamesstr
= ()

remove_all

funcremove_all(*tagnames: str) -> None

Remove child elements with tagname (e.g. "a:p") in tagnames.

paramtagnamesstr
= ()

Returns

None

xpath

funcxpath(xpath_str: str) -> Any

Override of lxml _Element.xpath() method.

Provides standard Open XML namespace mapping (nsmap) in centralized location.

paramxpath_strstr

Returns

typing.Any

On this page