CT_Table
paper-pptx 0.2.0 API reference
a:tbl custom element class
Attributes
bandCol
attributebandColboolbandRow
attributebandRowboolfirstCol
attributefirstColboolfirstRow
attributefirstRowboolget_or_add_tblPr
attributeget_or_add_tblPrCallable[[], CT_TableProperties]lastCol
attributelastColboollastRow
attributelastRowbooltblGrid
attributetblGridCT_TableGrid= OneAndOnlyOne('a:tblGrid')tblPr
attributetblPrCT_TableProperties | None= ZeroOrOne('a:tblPr', successors=(_tag_seq[1:]))tr
attributetr= ZeroOrMore('a:tr', successors=(_tag_seq[3:]))tr_lst
attributetr_lstlist[CT_TableRow]xml
attributexmlstrXML string for this element, suitable for testing purposes.
Pretty printed for readability and without an XML declaration at the top.
Functions
add_tr
funcadd_tr(height: Length) -> CT_TableRowReturn a newly created a:tr child element having its h attribute set to height.
paramheightLengthReturns
pptx.oxml.table.CT_TableRowfirst_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= ()insert_tr_at
funcinsert_tr_at(idx: int, height: Length) -> CT_TableRowReturn a new a:tr inserted so it becomes the row at idx (paper-pptx addition).
paramidxintparamheightLengthReturns
pptx.oxml.table.CT_TableRowiter_tcs
funciter_tcs() -> Iterator[CT_TableCell]Generate each a:tc element in this tbl.
a:tc elements are generated left-to-right, top-to-bottom.
Returns
typing.Iterator[pptx.oxml.table.CT_TableCell]new_tbl
funcnew_tbl(rows: int, cols: int, width: int, height: int, tableStyleId: str | None = None) -> CT_TableReturn a new p:tbl element tree.
paramrowsintparamcolsintparamwidthintparamheightintparamtableStyleIdstr | None= NoneReturns
pptx.oxml.table.CT_Tableremove_all
funcremove_all(*tagnames: str) -> NoneRemove child elements with tagname (e.g. "a:p") in tagnames.
paramtagnamesstr= ()Returns
Nonetc
functc(row_idx: int, col_idx: int) -> CT_TableCellReturn a:tc element at row_idx, col_idx.
paramrow_idxintparamcol_idxintReturns
pptx.oxml.table.CT_TableCellxpath
funcxpath(xpath_str: str) -> AnyOverride of lxml _Element.xpath() method.
Provides standard Open XML namespace mapping (nsmap) in centralized location.
paramxpath_strstrReturns
typing.Any