Paper Office
paper-docxAPI referenceoxml.table

CT_TblPr

paper-docx 0.2.0 API reference

<w:tblPr> element, child of <w:tbl>, holds child elements that define table properties such as style and borders.

Attributes

alignment

attributealignmentWD_TABLE_ALIGNMENT | None

Horizontal alignment of table, None if ./w:jc is not present.

autofit

attributeautofitbool

False when there is a w:tblLayout child with @w:type="fixed".

Otherwise True.

bidiVisual

attributebidiVisualCT_OnOff | None
= ZeroOrOne('w:bidiVisual', successors=(_tag_seq[4:]))

get_or_add_bidiVisual

attributeget_or_add_bidiVisualCallable[[], CT_OnOff]

get_or_add_jc

attributeget_or_add_jcCallable[[], CT_Jc]

get_or_add_tblLayout

attributeget_or_add_tblLayoutCallable[[], CT_TblLayoutType]

jc

attributejcCT_Jc | None
= ZeroOrOne('w:jc', successors=(_tag_seq[8:]))

style

attributestyle

Return the value of the val attribute of the <w:tblStyle> child or None if not present.

tblLayout

attributetblLayoutCT_TblLayoutType | None
= ZeroOrOne('w:tblLayout', successors=(_tag_seq[13:]))

tblStyle

attributetblStyleCT_String | None
= ZeroOrOne('w:tblStyle', successors=(_tag_seq[1:]))

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