docx_parser_converter.docx_parsers.tables.table_row_parser module

class docx_parser_converter.docx_parsers.tables.table_row_parser.TableRowParser[source]

Bases: object

A parser for extracting table rows from an XML element.

static parse(row_element: Element) TableRow[source]

Parses a table row from the given XML element.

Parameters:

row_element (etree.Element) – The row XML element.

Returns:

The parsed table row.

Return type:

TableRow

Example

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

<w:tr>
    <w:trPr>
        <w:trHeight w:val="300"/>
        <w:tblHeader/>
    </w:trPr>
    <w:tc>
        <w:tcPr>
            <w:tcW w:w="5000" w:type="dxa"/>
        </w:tcPr>
        <w:p>
            <!-- Paragraph content here -->
        </w:p>
    </w:tc>
    <w:tc>
        <w:tcPr>
            <w:tcW w:w="5000" w:type="dxa"/>
        </w:tcPr>
        <w:p>
            <!-- Paragraph content here -->
        </w:p>
    </w:tc>
</w:tr>