Table Width Incompatibilities - any way to resolve?

We are trying to generate some documents that contain tables and while we can get them to render well in OnlyOffice, we are having issues with the compatibility for users who might want to open these resulting .docx files in Google Docs and Word (to a lesser extent).

https://api.onlyoffice.com/docbuilder/textdocumentapi/apitablepr/setwidth

Taking this example from your website - it obviously works fine in the inline viewer.

However, on Word this appears as:
image

And, on Google Docs this appears as:
image
(also green for some reason relating to the underlying style - not so concerned about that)

In our own examples, Word does a little better when it has content in the cells but Google Docs really fails badly and will limit itself to a fixed width table covering part of the width only.

We tried setting some of the individual cell widths and changing from percentages to twips etc.

We are trying to use DocBuilder to create templates that users can edit in their own preferred editors. Is there a recommended way of getting consistent column widths in tables that will work across the major editors?

Many thanks in advance,
Dave

Hello, @molloyda
We haven’t seen in a long time:)

I have a few questions:

  1. Which version of DocBuilder are you using?

Try using this script:
https://api.onlyoffice.com/docbuilder/textdocumentapi/apitable/setwidth

  1. Are you uploading .docx format to Google Docs using the mentioned script, or are you making any modifications?

Hi Nikolas,
Thanks for coming back to me on this!

  1. Currently I’m just building the docbuilder file and testing it against your TryIt page. I wanted to try to see if I could build consistent templates with all required aspects before implementing this programmatically.

In this case I’m just taking your demos and selecting to Save them as .docx formats and then opening these files in Word (Mac), Office 365 (Browser) and Google Docs.

  1. So taking this newer example:

If I select the output on that page you’ve linked and select ‘File’ and save as ‘docx’

Then if I open it in OnlyOffice (Desktop), it looks fine:

If I open it in Word (Mac), it also appears fine.

In Office 365 seems to be ok also:

However, in Google Docs it looks like:
image

So basically - no local installations at all. If you were to save your own example from that script and open it in Google Docs you should probably see the same thing.

The green in Google Docs probably just has to do with inherited style in that example so can be worked around. However, I’ve been unable to set the width of tables or columns using your DocBuilder API and have it work in Google Docs.

Googling there are some possibly related issues (not OO specific): https://github.com/dolanmiu/docx/issues/216

But it seems that Google Docs have form in this area… but if you create a table in Word then it will open correctly with the correct cell and table widths in Google Docs.

And my use case would require anything we generate in DocBuilder to also work in google docs.

Many thanks again for coming back - hopefully this information helps.
Dave

1 Like

Actually I just also noticed that Office 365 has one of the rows missing. Just thought I’d mention it also.

1 Like

I apologize for the delay in responses.

This is most likely a bug.

We are checking the situation.
I will let you know when I get something.

:+1: Thank u

hey @molloyda

We have created bug report based on this case.
Thank you for reporting this issue.

Please accept our apologies for the inconvenience caused. We will try to fix the bug in the next versions.

1 Like