[英]Python-Docx Columns
I am trying to format a piece of text into columns.我正在尝试将一段文本格式化为列。 There are two aspects that I am trying to achieve:我试图实现两个方面:
I am trying to have multiple sections within a page.我试图在一个页面中有多个部分。 The first paragraph to have only one column layout and the rest of the paragraph to be formatted as two column text.第一个段落只有一个列布局,段落的其余部分被格式化为两列文本。 I have tried creating different sections, then add paragraph and then create another section with two column layout, but no success.我尝试创建不同的部分,然后添加段落,然后创建具有两列布局的另一个部分,但没有成功。 I am ending up messing up layouts.我最终搞砸了布局。
In any case, I am creating sections and 2 column lay out as per below suggestion: How to programatically implement Columns in page layout as of in MS Word using python-docx无论如何,我正在按照以下建议创建部分和 2 列布局: 如何使用 python-docx 在 MS Word 中以编程方式实现页面布局中的列
Appreciate any help.感谢任何帮助。
I found the solution - it needed to add me a section break at the end of columns.我找到了解决方案 - 它需要在列的末尾添加一个分节符。 This was just as good as adding a new section as per below:这就像添加一个新部分一样好,如下所示:
section = document.add_section(WD_SECTION.CONTINUOUS)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.