Comments (4)
Hi Charl, what I would do would be to see what Word does when you set it the way you want and try to duplicate that.
One way to do that is to use opc-diag to browse a before and after version of the .docx file. The command would be something like this:
$ opc diff-item before.docx after.docx document.xml
I expect the difference comes down to a few elements and/or attributes in the table properties XML.
If you can narrow it down to those specifics I can give you a couple lines of code to put that XML in place. You can wrap that in a function or method and call it in the right spot in your code.
Once we have it working we can noodle a bit what the API for doing it directly from the library wants to look like and then we can add it to the backlog.
Want to give that a shot?
from python-docx.
Thanks for responding so quickly!
I'd like to try that. However, here I have only LibreOffice 4.1.4.2 to test the DOCX, and that generates a whole lot of extra code in the resultant file. Tomorrow at work I hope to be able to test with a real-deal Word and look at the differences.
from python-docx.
A kind colleague just checked with MS Word and there it renders correctly.
Sorry for the disturbance. Hopefully this closed issue report will help other LibreOffice users in the future. :)
Thanks again,
Charl
from python-docx.
No worries, thanks Charl :)
from python-docx.
Related Issues (20)
- Docu: Reference to root package missing in object.inv file HOT 1
- Insert picture issue python-docx
- Newer version python 3.7+ not reading .docm HOT 3
- How can I convert it to XML
- Replace or add text to a table cell paragraph without altering paragraph font properties HOT 2
- @mustash @scanny Could you please complete your code a little more, I am too naive to work it out. Besides, where does the 'self' come from? Thank you. wish you could still see my question :)
- bug: cannot generate docs on python 3.10 HOT 5
- Missing patterns in .gitignore HOT 1
- Memory leak when using docx.Document() with io.Bytes HOT 3
- Reading bullet point values #1187[]
- A row in a table cannot span multiple pages.
- I encountered an issue while processing the table in the attachment
- Clean way to create a multi-column document
- TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
- Unable to get text of MergeFields (sometimes)
- 怎么样获取word中生成的序号
- 读取table表格合并的问题 HOT 1
- Ignoring Alt Text Retrieval when Iterating through docx.paragraphs HOT 1
- Duplicate document styles
- "FollowedHyperlink" cannot be found in some documents even though it is present in all. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-docx.