-
Notifications
You must be signed in to change notification settings - Fork 546
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
feature: cell border #71
Comments
Hi, are you still planning to implement this feature? If not, is there a way that I can incorporate this functionality until a feature is built? For now, I need the ability to draw horizontal borders across multiple cells in a table, and set the color, weight and style. |
👍 for this feature request. |
I would benefit from this feature as well! If it won't be implemented for a while, have any hints for how to access this xml feature? |
Are there any workarounds to this? I've run into a scenario where I'd like to change the border in a table. Can the default be changed such that no borders are introduced in a table (as a workaround)? |
I found this thread. One thing to note is that order appears to be important. In my case, the lnB element had to come before the solidFill element! https://groups.google.com/forum/#!topic/python-pptx/UTkdemIZICw |
A reproducible example; as dereitz mentioned, make sure you set the
|
Actually that link in my previous only works for Excel. Hex dumping a table with a border doesn't reveal how it does it. |
@MartinPacker judging from how the PowerPoint UI allows borders to be applied I'd say that's on a cell-by-cell basis, like to put a border around a table you have to visit each perimeter cell and set its outward-facing borders to the desired value. If I select the table and click on "Table Design > Borders > Outside Borders" then PowerPoint applies those individually to each perimeter cell. Interestingly, if I then add a new row at the bottom by tabbing through the last cell, it carries those borders down in the expected way. So it must have some "border-moving" logic in there on growing or shrinking the table. It's possible such a thing can be set using a customized table style but it's not immediately clear to me how after a look at the schema. I expect there is a series of experiments between here and knowing with confidence what can be managed there. |
Right. That's what I gathered. And that implies one of two approaches:
If I do this I think I can manage to do Option 1 in md2pptx - as I know the numbers of rows and columns when creating the table. But I can see in general this wouldn't be fun for python-pptx to do. Also I notice the snippet @ahuang11 posted appears to have a copyright notice of yours. Does that mean this code isn't open source? If so I will re-implement by adding elements / attributes individually. (Actually I should probably do that for flexibility.) I ask about Copyright as I want md2pptx to remain MIT licensed. |
I found that code here so I'm not sure: |
No, there's no copyright. @ahuang11 Just a URL to the mailing-list source is fine if you want to add a citation, but I'm not particular about that. Best not to add a copyright though. Anything I post here or on SO or a mailing-list is public domain as far as I'm concerned. |
set borders of table cell; left, right, top, and bottom
Attributes: color (fill), thickness (weight), style (single, thick-thin, thin-thin, etc.), inset pen (inside boundary or centered on it), line join (round, bevel, miter), and line cap (round, square, flat).
The text was updated successfully, but these errors were encountered: