Skip to content

Table with fixed column sized are not working properly #25

@Thylowz

Description

@Thylowz

I can't manage to make csv-table generate self-fixed column widths.

After analysis, I could see that both options "width" and "widths" had to be set, but even then it was not enough, at least for the Word version I used (office 365).

It seems due the fact that w:tblLayout is not specified even if table is detected as is_fixed_width.

EDIT: 1 year later update ==> the problem was also due to my pipeline which was reopening Word document via win32com. In this case Word automatically resize the document.

So as stated, if you want to make sure your docx won't lose table sizes (if you set them as fixed at the beginning), then in docx.py, you should add to the property_tree (function make_table) a property [['w:tblLayout', {'w:type': 'fixed'}]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions