docx_parser_converter.docx_parsers.tables.table_grid_parser module

class docx_parser_converter.docx_parsers.tables.table_grid_parser.TableGridParser[source]

Bases: object

A parser for extracting the table grid from an XML element.

static parse(table_element: Element) TableGrid | None[source]

Parses the table grid from the given XML element.

Parameters:

table_element (etree.Element) – The table XML element.

Returns:

The parsed table grid, or None if not found.

Return type:

Optional[TableGrid]

Example

The following is an example of a table grid element in a document.xml file:

<w:tblGrid>
    <w:gridCol w:w="5000"/>
    <w:gridCol w:w="5000"/>
</w:tblGrid>