Python docxtpl-如何更改列的大小?
我正在使用docxtpl生成word文档。我正在向Word文档插入多个表,并想知道如何更改代码中特定列的大小 以下是my template.docx中的表格: 该表在报告中的外观如图所示: 下面是我如何将表插入docx的概览:Python docxtpl-如何更改列的大小?,python,python-3.x,ms-word,docx,Python,Python 3.x,Ms Word,Docx,我正在使用docxtpl生成word文档。我正在向Word文档插入多个表,并想知道如何更改代码中特定列的大小 以下是my template.docx中的表格: 该表在报告中的外观如图所示: 下面是我如何将表插入docx的概览: ## Create panda data frame from the dict df_bauwerke = pd.DataFrame.from_dict(outDict['Bauwerke']['Schlüsselbauwerke'], orient
## Create panda data frame from the dict
df_bauwerke = pd.DataFrame.from_dict(outDict['Bauwerke']['Schlüsselbauwerke'], orient='index')
## Convert panda df to DocxTemplate table format
table_bauwerke = {
"bauwerke_col_labels": list(df_bauwerke.columns.values),
"bauwerke_tbl_contents": [{"cols": rows} for rows in df_bauwerke.values.tolist()]}
context_to_load.update(table_bauwerke)
我想更改“Jahr”和“Name”列的宽度(Name更大,Jahr更窄),其余的保持不变。我能在我的剧本中影响它吗