1

The default table style in XWiki looks fine in the web page, but when the page is exported as PDF, every table's border just disappeared and the whole table looks crammed. I tried |(% border="1" %) header1, |(% style="border:1" %),|(% style="border:1 solid black" %) or something like that, all without luck.

But after all, all I wanted to do is getting a portable and printable copy of some or one of the wiki pages. Exported as word format renders more unreadable tables plus wrong list numbers and exported as HTML wraps the whole page in a zip file with too much unnecessary content included. The PDF format is somewhere near the sweet spot, Is there anything else I could try to accomplish this?

carusyte
  • 1,549
  • 17
  • 21
  • If you want to adapt the PDF styling you can look at the docs at http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Configuration#HCustomizingthePDFexportLook26Feel (short version : attach a `pdf.css` to your `XWiki.DefaultSkin` with the modifications you want). Unfortunately the Apache FOP lib that the PDF export uses is not very kind to table styles, especially sizes. Personally I prefer the "print preview" to export a printable version of a XWiki page. – Clemens Klein-Robbenhaar May 31 '16 at 13:43
  • @ClemensKlein-Robbenhaar That rang a bell. Now I'm taking your advice to print preview a page and then copy the main content to a blank word file in order to exclude all the unnecessary decorations. – carusyte Jun 02 '16 at 14:43

1 Answers1

2

Try:

(%style="border: 1px solid #ccc"%)
|1|2
  • I tested this code in my company and it really works. No doubt +1 for this answer (but my reputation is not enough for me to vote publicly!). However, I noticed that I did not address the question very well, this style only renders a solid border around the whole table, all cells are still displayed without grid lines. I guess I will also try to prepare a custom .css file in the XWiki.DefaultSkin to see if it solves the problem. If it works, every wiki editor won't have to add this extra style code in every table. – carusyte Jun 07 '16 at 15:51