-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
LibreOffice displays some pandoc docx tables too wide #2576
Comments
Your table looks fine in both HTML and docx when I try it. As for the second issue, in multiline tables, you control If you want the Cost column to be right-justified, do it
|
Using the table code ( The table extends beyond the text margins by about half an inch on either side. Using It might be possible to tweak the ConTeXt macro for Maybe there's something else I'm missing? |
If you use a simple table (rather than a multiline table - see the manual for the lingo) then you won't get explicit column widths. |
Simple table doesn't produce output for DOCX that loads in either LibreOffice 4.4.6 or LibreOffice 5.0.3. Item Kilowatts Use Cost
---------------- --------------- ---------------- -----------
Geothermal Plant **`1250.0`** Electricity **` 4.4`**
Houses **`13.7`** Shelter **` 4.2`** This was converted using:
Load it in LibreOffice v4.x or v5.x on Ubuntu Linux. The result is the same as before: Since the double-spaced tables are working in LibreOffice, I dumped the XML for the double-spaced table (double-table.xml) and simple table (simple-table.xml), then performed a $ diff double-table.xml simple-table.xml
16c16
< <w:tblW w:type="pct" w:w="5000.0" />
---
> <w:tblW w:type="pct" w:w="0.0" />
19,24c19
< <w:tblGrid>
< <w:gridCol w:w="2996" />
< <w:gridCol w:w="1819" />
< <w:gridCol w:w="1926" />
< <w:gridCol w:w="1177" />
< </w:tblGrid>
---
> <w:tblGrid /> Perhaps |
I'm running into this problem when converting from HTML to DOCX using pandoc. My particular problem would most probably be solved by either:
(For me, the issue surfaces as too-wide cells in LibreOffice, and extremely narrow cells in Pages.) |
There seems to be workaround by setting the --columns options to a low value (e.g. 10), and that would trigger the correct table formatting in pandoc for libreoffice
Gives the following table xml in the document.xml
The output in libreoffice Setting the
The table xml in the document.xml for
The output in libreoffice The test.md contained the following table content
|
This was fixed via 0921b82. |
A table was marked up as follows:
This produced the desired outcome in the PDF using ConTeXt:
But DOCX did not display all the columns:
To resolve the issue, a different Markdown table format was used:
This fixed the DOCX issue:
And produced the following ConTeXt code:
Normally, that will produce a table. But my page layout settings are interfering with the amount of space allocated for the table, which prevents the table from appearing. But that's a side issue. The problem of concern is that the numeric columns are no longer right-justified:
I'm able to reinstate the justification and force the table to appear using the following command:
It's a hack, though, and doesn't right-justify the columns in the DOCX (a minor issue).
There should be a way to use the first markdown table to produce similar results for both ConTeXt and DOCX.
The text was updated successfully, but these errors were encountered: