Skip to content

ValueError while acess cell._tc.bottom #1458

@mepwang

Description

@mepwang

OS: updated ubuntu 24.04
Python: 3.12.8
Python-Docx: 1.1.2

test.docx

while parsing table in docx, ValueError exception occurred:
ValueError: no tc element at grid_offset=3

in line: bottom = cell._tc.bottom

code:

    for row_idx, row in enumerate(table.rows):
        for cell_idx, cell in enumerate(row.cells):
            top = cell._tc.top
            bottom = cell._tc.bottom
            left = cell._tc.left
            right = cell._tc.right

docx file: see test.docx in attachment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions