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

Distribute columns (width) evenly in tables #64

Open
GhostyIs1337 opened this issue Nov 10, 2022 · 2 comments
Open

Distribute columns (width) evenly in tables #64

GhostyIs1337 opened this issue Nov 10, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@GhostyIs1337
Copy link

Is this possible with OpenXML/this API? I haven't seen it anywhere.

https://learn.microsoft.com/en-us/office/vba/api/word.columns.distributewidth

image

@PrzemyslawKlys
Copy link
Member

I don't think it exsists in the openxml:

As per:

The width of the table that autofits to "page" is 5000 (according to @hisuwh) . So to introduce this feature, we need to add 5000/numberOfColumns I guess. Someone would need to test this theory ;-)

@PrzemyslawKlys
Copy link
Member

Actually, it was simpler than I thought. Added two methods, DistributeColumnsEvenly and SetWidthPercentage, which can help split the table as you want it. Haven't tested if there are specific column sizes defined, may need to be adjusted to remove specific sizing of columns when defining that. Will require testing

@PrzemyslawKlys PrzemyslawKlys added the enhancement New feature or request label Nov 12, 2022
@PrzemyslawKlys PrzemyslawKlys added this to the 5.0 milestone Nov 20, 2022
@PrzemyslawKlys PrzemyslawKlys self-assigned this Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants