Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Wide table gets cutoff in PDF

RobertC July 2, 2014

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?

11 answers

1 accepted

0 votes
Answer accepted
RobertC July 23, 2014

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.

1 vote
Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 3, 2018

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

1 vote
Kate Hanna April 11, 2018

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.

Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 3, 2018

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

1 vote
Amir Cicak November 2, 2017

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.

1 vote
Nils Bier _K15t_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 3, 2014

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

1 vote
Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 3, 2014

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).

0 votes
Deleted user July 25, 2019

I solved this issue by reducing the length of different links that I've inserted into my table.

Basically you simply have to watch out for long words that force the table column to have a certain minimum width.

Hope that helps.

Cheers,

Martin

0 votes
Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 3, 2018

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

0 votes
Erika August 3, 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)

0 votes
Derek Huether April 19, 2018

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
Andrey Khaneev _StiltSoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 2, 2017

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events