python-pptx icon indicating copy to clipboard operation
python-pptx copied to clipboard

Feature: Table Cell Borders

Open ofir123 opened this issue 7 years ago • 12 comments

Hi! I've added access for both borders and span settings of table cells. Access to these attributes will look like this:

cell = table.cell(0,0)
cell.grid_span = 2
top_border = cell.borders.top
top_border.fill.solid()
top_border.width = Pt(1)
...

ofir123 avatar Jul 22 '18 22:07 ofir123

@scanny hmm not sure what made the tests fail (passed on all envs but 3.4)...

ofir123 avatar Jul 22 '18 23:07 ofir123

@scanny Is there anything wrong with the PR? Something missing?

ofir123 avatar Jul 31 '18 20:07 ofir123

@scanny ok tests are green now :) Can you please merge? (or at least comment?)

ofir123 avatar Aug 12 '18 20:08 ofir123

Hi @ofir123, main thing that's missing is the analysis page, this is a typical one: https://github.com/scanny/python-pptx/blob/master/docs/dev/analysis/dml-gradient.rst.

Creating one of these and getting a commit on it is the important first step in getting a new feature merged. This is where the API and calling protocol are decided. Those are critically important decisions because they cannot be changed once released, whereas all the implementation details can be changed as needed.

Generally, best practice is to start with the analysis page (also called an feature proposal), before starting coding, given that the decisions made there often have a profound effect on the implementation. But it can be done later too, as long as you don't mind reworking your code to suit once the interface is decided.

scanny avatar Aug 13 '18 00:08 scanny

Thank you very much for the elaborate explanation! I'll start working on a proper analysis page :)

ofir123 avatar Aug 13 '18 22:08 ofir123

@scanny All done! Waiting for your notes on the dev analysis page... (and sorry it took so long)

ofir123 avatar Sep 15 '18 22:09 ofir123

Fixed everything @scanny!

ofir123 avatar Sep 18 '18 11:09 ofir123

Also @ofir123 I'll need you to rebase your PR branch onto the latest master and not use merge commits. The python-pptx project maintains a straight-line commit history and merge-commits make my work harder than I like. Once we get a feature branch in place for this (maybe today) that can be the base for your commits. Let me know with any questions.

scanny avatar Sep 29 '18 19:09 scanny

@scanny I have no problem changing what you asked, but I prefer to wait for you to merge it to master first (so I'd change my implementation as well). Regarding the rebase, I've rearranged the commits. Is it ok now?

ofir123 avatar Oct 01 '18 11:10 ofir123

@scanny Not sure why this PR isn't being merged :( I fixed everything you asked for.. what am I missing?

ofir123 avatar Jan 04 '19 13:01 ofir123

When it will be added to main repository?

adrian-jasinski avatar Mar 08 '19 10:03 adrian-jasinski

@scanny @ofir123 If everything looks good, may I request this branch to be merged so that we can have functionalities for table cell borders? Thanks for the great work from both of you!

Huanting-Wu avatar Jan 07 '20 20:01 Huanting-Wu