Python-docx, how to set cell width in tables?

前端 未结 3 1033
野性不改
野性不改 2020-12-17 10:21

How to set cell width in tables?, so far I got:

from docx import Document
from docx.shared import Cm, Inches

document = Document()
table = document.add_tabl         


        
3条回答
  •  鱼传尺愫
    2020-12-17 10:23

    docs of python_docx

    allow_autofit attribute was default set to be True, which mean the width set will not take effect, so: table.allow_autofit = False

提交回复
热议问题