Skip to content
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: Table.add_row() and .add_column() #86

Open
scanny opened this issue Apr 16, 2014 · 6 comments
Open

feature: Table.add_row() and .add_column() #86

scanny opened this issue Apr 16, 2014 · 6 comments
Labels
Milestone

Comments

@scanny
Copy link
Owner

scanny commented Apr 16, 2014

Ability to dynamically add to a table, especially adding a row, is very handy when pulling records from a datasource where the length of the list may vary.

@ghost
Copy link

ghost commented May 5, 2014

Yes, this would be very useful!

@adamtwiss
Copy link

This is exactly what I am looking for as well. My use case is I have a variable number of records (but small enough to fit on one slide) and I want to add a table row for each tiem.

@scanny scanny added the table label Jun 15, 2014
@scanny scanny modified the milestone: Shortlist Nov 16, 2014
@smcpherson
Copy link

+1 - would be very useful, as it could potentially allow for table formatting to be done in powerpoint template, while insertion of rows / columns could be done dynamically via Table.add_row()

@Ignisor
Copy link

Ignisor commented Jun 27, 2018

#399 - here is my solution if someone would face the same need.

@scanny
Copy link
Owner Author

scanny commented Sep 23, 2018

A few notes based on my recent study of tables:

  • Adding a row or column should be fairly straightforward. Inserting a row or column at an arbitrary position might be somewhat more challenging but is probably a better choice.

    The challenge here would be how to deal with merged cells. The PowerPoint UI seems to have pretty clear semantics about how to deal with merged cells, which is basically extending the merge to incorporate the new row or column when it comes in the middle of the merge-region.

    API might be _Cell.insert_column(side=LEFT) etc. Adding a row or column would just be Table.cell(-1, -1).insert_column(side=RIGHT) although perhaps Table.add_row() and Table.add_column() convenience methods would be worthwhile.

  • Deleting a row or column would be complicated by merged cells and hyperlinks. Again, the PowerPoint UI semantics appear pretty clear, so the behavior would be well defined. Merged cells would need to be "shrunk" in certain scenarios and multiple grid rows/columns would need to be deleted when the cell was a merge-origin.

    Any hyperlinks encountered in table content would need to be deleted from the relationships collection for the slide. I think that's the only related content there could be.

@astafan8
Copy link

Hi! Are there any news on this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants