-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Content of merged cells #1442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sounds plausible. What is the specific before and after text of the cells? The "\n" in the docs would be in |
If you merged the top version you would receive the bottom version but with "Apple\nApple". The merging algorithm doesn't have anything to do with deduplicating text. You'll have to take care of that yourself. |
Thanks for taking a look at this @scanny. From the documentation it said "An original cell having no content is skipped in the contatenation process" so I thought by doing |
This is the code that controls that behavior: I expect what's happening is that a paragraph with a run that contains the empty string is considered distinct from a paragraph with no runs. The latter being what you get if the cell was empty from the start. If you wanted to hack something in then this might produce the result you're looking for: # -- instead of `cell.text = ""`... --
tc = cell._tc
tc.clear_content()
p = tc.add_p() This is what the |
I am merging cells with the same content where I want the following table
to merge to
Based on this (from the documentation):
I thought the following code should produce a merged cell with only one paragraph, however it looks like there are two paragraphs in the merged cell.
Result:
Is this expected?
The text was updated successfully, but these errors were encountered: