Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

PDF Export Style Changes in Confluence 6.7

Frederik D_ February 25, 2018

We always used Custom PDF CSS Styles to make sure tables print nice in PDF Exports. This has been working somewhat okay for a long time using the known workarounds and styles like

table
{
   table-layout: auto !important;
   width: auto !important;
}

However since we upgraded to Confluence 6.7 the PDF Export styles don't work so well anymore. Small-ish columns with relatively short content now all of the sudden get super squeezed to the effect that only 3 or 4 characters are shown per line and other columns use up the majority of the space - whereas previously the columns would still maintain a certain minimum width.

The only workaround I found so far was to set the following style but this is really dodgy and makes some columns (like the numbering column) bigger than they need to be.

table > thead > tr > td,  
table > tbody > tr > td,  
table > tfoot > tr > td,  
table > tr > td  
{  
   min-width: 75px !important;  
}

I would just like to know where the PDF Export Style changes come from and how I can restore the previous behaviour.

Thanks.

1 answer

0 votes
James Richards
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 11, 2018

Hi Frederik,

 

So, in Confluence 6.2.1 there was a bug fix because wide tables were getting cut off because they were too wide

And what you're seeing is the result of the fix.

So, we have a new bug opened which goes into more detail for this fix.

The wide tables are defined with 

table.fixedTableLayout {
    table-layout: fixed;
    width: 98% !important;
}

So if you overload .fixedTableLayout with your CSS, you might get the result you're looking for.

(Actually, I've updated the bug with your CSS as it's better than my original which was just for table-layout)

Thanks, James

Frederik D_ March 12, 2018

Hi James,

Thanks a lot. At least I know now where this is coming from.

Unfortunately adding .fixedTableLayout does not seem to solve the issue. I removed our min-width overrides and added the .fixedTableLayout class to the table overrides (i.e. exactly as it is now described on https://jira.atlassian.com/browse/CONFSERVER-54275 as a workaround) but I still have the issue that the smaller columns are too small.

Also the issue described in https://jira.atlassian.com/browse/CONFSERVER-54275 seems to be different to what I described above. Our issue is that when the workaround is applied then the small columns are too small - i.e. the issue is not that the columns are equal width.

Also to add here: our Confluence tables are always using "responsive" layout, not "fixed". Does that make a difference here? Do I need to add .responsiveTableLayout instead then?

 

Cheers, Frederik

James Richards
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 12, 2018

Hi Frederik,

Sadly, no. Looking at the code I can see

 //add the class - fixedTableLayout - to a table if the content of table headers is too long to be fit into a page.

So, we're going to either have fixed widths, or what we have in the bug report. There doesn't seem to be a workaround yet that will meet everyone's needs.

Regards, James

Frederik D_ March 13, 2018

Shame. :/

We kind of got it okay now with the following workarounds but not really ideal:

table
{
   table-layout: auto !important;
   width: auto !important;
}
    

table > thead > tr > td > table,
table > tbody > tr > td > table,
table > tfoot > tr > td > table,
table > tr > td
{
   table-layout: auto !important;
   width: auto !important;
}

/* work-around to make sure that columns like # don't get squeezed too much  */
th
{  
   min-width: 75px !important;  
}
th.numberingColumn
{
   min-width: 25px !important;  
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events