CT_TableCell
paper-pptx 0.2.0 API reference
a:tc custom element class
Attributes
anchor
attributeanchorMSO_VERTICAL_ANCHOR | NoneString held in anchor attribute of a:tcPr child element of this a:tc element.
col_idx
attributecol_idxintOffset of this cell's column in its table.
get_or_add_tcPr
attributeget_or_add_tcPrCallable[[], CT_TableCellProperties]get_or_add_txBody
attributeget_or_add_txBodyCallable[[], CT_TextBody]gridSpan
attributegridSpanint= OptionalAttribute('gridSpan', XsdInt, default=1)hMerge
attributehMergebool= OptionalAttribute('hMerge', XsdBoolean, default=False)is_merge_origin
attributeis_merge_originboolTrue if cell is top-left in merged cell range.
is_spanned
attributeis_spannedboolTrue if cell is in merged cell range but not merge origin cell.
marB
attributemarBLengthBottom margin value represented in marB attribute.
marL
attributemarLLengthLeft margin value represented in marL attribute.
marR
attributemarRLengthRight margin value represented in marR attribute.
marT
attributemarTLengthTop margin for this cell.
This value is stored in the marT attribute of the a:tcPr child element of this a:tc.
Read/write. If the attribute is not present, the default value 45720 (0.05 inches) is
returned for top and bottom; 91440 (0.10 inches) is the default for left and right.
Assigning None to any marX property clears that attribute from the element,
effectively setting it to the default value.
rowSpan
attributerowSpanint= OptionalAttribute('rowSpan', XsdInt, default=1)row_idx
attributerow_idxintOffset of this cell's row in its table.
tbl
attributetblCT_TableTable element this cell belongs to.
tcPr
attributetcPrCT_TableCellProperties | None= ZeroOrOne('a:tcPr', successors=(_tag_seq[2:]))text
attributetextstrstr text contained in cell
txBody
attributetxBodyCT_TextBody | None= ZeroOrOne('a:txBody', successors=(_tag_seq[1:]))vMerge
attributevMergebool= OptionalAttribute('vMerge', XsdBoolean, default=False)xml
attributexmlstrXML string for this element, suitable for testing purposes.
Pretty printed for readability and without an XML declaration at the top.
Functions
append_ps_from
funcappend_ps_from(spanned_tc: CT_TableCell)Append a:p elements taken from spanned_tc.
Any non-empty paragraph elements in spanned_tc are removed and appended to the
text-frame of this cell. If spanned_tc is left with no content after this process, a
single empty a:p element is added to ensure the cell is compliant with the spec.
paramspanned_tcCT_TableCellfirst_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= ()new
funcnew() -> CT_TableCellReturn a new a:tc element subtree.
Returns
pptx.oxml.table.CT_TableCellremove_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