Wide table gets cutoff in PDF

I have a relatively wide table that displays fine in Confluence and in an HTML export. However, when I export to PDF, serveral columns get cutoff. There is no horizonatal scroll bar; when I widen the window, the text grows in size.

I am using Confluence on-demand. Are there any workarounds or configuration settings I can make?

10 answers

1 accepted

Accepted Answer
0 votes

I guess I'll have to get an on-premise instance; there are too many things for which I need plug-ins that only work on-premise.

Hello,

when the table is too wide for the PDF, it gets cut off. How it looks in HTML and PDF is often different.

All you can do, is try to make the table smaller:

  1. check for anything that bloats the table cell (long words that don't break, images, etc.)
  2. change the font size in table cells (try to make it smaller to have the text consume less space)
  3. check for the CSS setting of table-layout (if it is "auto" or "fixed")
  4. change the table completely (more length, less width)

In other words:

No workaround! Just the possibility for small adjustments.
What is possible with on-demand, I don't know: Probably you can't do anything that requires access to the PDF export stylesheet (that would be 3 and perhaps 2).

Hi Robert,

we've a page in our documentation regarding the handling of wide tables: https://www.k15t.com/display/PDF/How+Can+I+Deal+with+Wide+Tables

Altough this docs are written for our Scroll PDF Exporter which isn't available for OnDemand yet (https://jira.atlassian.com/browse/AOD-4869), you could try the mentioned workaround (similar to Steffen's tipps), but maybe a bit more detailed.

Cheers,
Nils

Problem I have is that however small table I make, Confluence expands it and cuts off last column regardless. This happens even if I set Fixed width instead of Responsive. There is literary no way for me to export the document except making screenshots of my browser and then creating document in another software composed of those images. I don't find that very productive.

As a workaround you cant try to export to PDF with Table Filter macro.

https://jira.atlassian.com/browse/CONFCLOUD-34390

See comment by Tom Simm

... menu, View Source

Then use your browser's print menu to save it as a PDF.

Thanks for explaining. I just couldn't understand the original sentence "Click View Source and the Print to PDF".

Have Confluence change the generated PDF by adding a 'PDF Export Stylesheet'. The one below can be used:

@page
{
/*A4-sized pages in landscape orientation are 297 mm wide by 210 mm long*/
size: 297mm 210mm;
}
0 votes
Erika I'm New Here Aug 03, 2018

Another work-around is to save the page as pdf by means of printing, and scale the contents to fit the table (ie. right click, print, format it to fit, save as pdf)

I had a second look at the topic.

There are in fact different CSS styles that determine the appearance of tables. Depending on how these styles are defined in the standard CSS stylesheet (the one that comes with Confluence) the exported PDF will look different, in some cases tables will break correctly, in some cases not.

To make it work for you, you have to redefine these styles, that is, overwrite the styles from the standard CSS stylesheet with your own.

To do this, do the following:

  • Go to the PDF Export Stylesheet
    (depending on your version somewhere around Browse > Space Admin > Look and Feel > PDF Stylesheet)
  • Enter the following code and play around with it:
table {  
word-wrap: break-word; /* try normal or break-word or initial or inherit */  
table-layout: fixed; /* try auto or fixed */  

In my Confluence version "fixed" does break the table correctly, "auto" does not.
The settings for "word-wrap" do not make much of a difference in this case, but "break-word" seems to make the most sense, so I used it, just in case.

Result for "table-layout: fixed"

greenshot_2018-08-03_12-06-50.jpg

Result for "table-layout: auto"

greenshot_2018-08-03_12-06-59.jpg

Because I was having fun with this, here is another example that illustrates the difference between "table-layout: fixed" and "table-layout: auto".

This is how the Confluence page looks like
Table cells have different widths because the width is adjusted to the content of the cell. Long words do NOT wrap. Because of this, the width of a cell is equal to the width of the longest word or image. If the total width of ALL the cells exceeds the page width, a scroll bar is added.

greenshot_2018-08-03_12-43-02.jpg

This is how the PDFs page looks like with "table-layout: fixed"
The table cells all have the same width. Long words do wrap to fit in the given space. Images are still cut off if they are too long.

greenshot_2018-08-03_12-40-02.jpg

This is how the PDFs page looks like with "table-layout: auto"
Table cells have different widths because the width is adjusted to the content of the cell. Long words do NOT wrap. Because of this, the width of the cells is equal to the width of the longest word or image. If the total width of ALL the cells exceeds the page width, the table is cut off.

greenshot_2018-08-03_12-41-24.jpg

The point is:
In the end, one has to decide which of the two table settings, "fixed" or "auto", works best for a given document

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 11, 2018 in Confluence

What are your project planning tips?

Hello Community,  Jessica here from the Confluence product marketing team! Today I wanted to get your takes on project planning –– what works, what doesn’t, how do you know if you’re doing it r...

242 views 1 4
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you