-
-
Notifications
You must be signed in to change notification settings - Fork 494
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
Wrong Table width when preview file & uploading Google Docs #216
Comments
Yes, Gogole docs, or finder is not supported Only Microsoft Word so far If you can figure out how to get the features working in each, that would be amazing |
I use Tab Stops to work around this, they work perfectly in both Pages and Google Docs. |
Would you please write somewhere in the documentation with bold font that this package does not support google docs ? It took more than 2 days for me to find it out and see this issue with table width. Thanks |
@vahid18u if you want you can add the warning on the documentation yourself and open a PR, |
Hi @carlbolduc , can you please explain how you use tab stops in your workaround? Everything else is working fine in my document, but tables. If your workaround works, you made my day!! |
Here is an example, I first create a line like this:
I can then add content to it:
And use tab stops to simulate a table:
|
@carlbolduc I have tried the tab stops and they don't seem to work in Google docs either.. perhaps the implementation has changed since Novemebr |
I'm using version 5.0.0-rc4. Anything else after that broke my implementation so I stay on this version. |
I have found the issue, it is because you need to explicitly specify the widths Most word processors aren't smart enough to figure out what width you want. Microsoft Word seems to be the exception and figures out the desired result nicely. Check out this demo on how to specify widths (column widths and cell widths): https://github.com/dolanmiu/docx/blob/master/demo/4-basic-table.ts here are the results from different word processors using that demo: Word 365:Libre Office:Google docs:In future, I will consider making |
Hi, dolanmiu. Thank you for awesome library.
I has a problem when creating a full-width table with code:
const table = doc.createTable(3, headers.length) table.setWidth(WidthType.PERCENTAGE, '100%')
It works fine when open in Microsoft Word, but wrong width when preview in Google Docs or Finder (I'm using MacOS).
Microsoft Word:
Google Docs:
Finder Preview:
The text was updated successfully, but these errors were encountered: