Paper Office
paper-pptxAPI referenceoxml.table

CT_Table

paper-pptx 0.2.0 API reference

a:tbl custom element class

Attributes

bandCol

attributebandColbool

bandRow

attributebandRowbool

firstCol

attributefirstColbool

firstRow

attributefirstRowbool

get_or_add_tblPr

attributeget_or_add_tblPrCallable[[], CT_TableProperties]

lastCol

attributelastColbool

lastRow

attributelastRowbool

tblGrid

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

attributexmlstr

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

Return a newly created a:tr child element having its h attribute set to height.

paramheightLength

Returns

pptx.oxml.table.CT_TableRow

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
= ()

insert_tr_at

funcinsert_tr_at(idx: int, height: Length) -> CT_TableRow

Return a new a:tr inserted so it becomes the row at idx (paper-pptx addition).

paramidxint
paramheightLength

Returns

pptx.oxml.table.CT_TableRow

iter_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_Table

Return a new p:tbl element tree.

paramrowsint
paramcolsint
paramwidthint
paramheightint
paramtableStyleIdstr | None
= None

Returns

pptx.oxml.table.CT_Table

remove_all

funcremove_all(*tagnames: str) -> None

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

paramtagnamesstr
= ()

Returns

None

tc

functc(row_idx: int, col_idx: int) -> CT_TableCell

Return a:tc element at row_idx, col_idx.

paramrow_idxint
paramcol_idxint

Returns

pptx.oxml.table.CT_TableCell

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