The library that we use to generate PDF exports in Scroll PDF Exporter v4.x, differs to that used by the native Confluence exporter and our previous version of the app, Scroll PDF Exporter v3.x.
Therefore, in comparison, Confluence tables are processed differently during the export and this page explains how tables are handled in Scroll PDF Exporter v4.x.
Table behavior overview
Confluence table formatting
When adding a table to Confluence you have two options available to define how table columns are formatted. These are:
- Responsive: Table columns get wider as you add content. Users can drag column borders on the page to set the width relative to each other and the page.
- Fixed width: Users can drag column borders to set the width. The table always appears with the width you set.
These two settings are found in the Confluence toolbar when editing a table:
Depending on the table option you have selected on your page, this will impact how the table is exported by Scroll PDF Exporter v4.x.
How Responsive tables are handled
If you add a responsive table to your Confluence page but do not adjust the table column widths, the table will be exported similarly to that shown on the Confluence page (relative widths of columns preserved in export).
The table below has been added without any modification to the column widths:
The resulting PDF Export with the bundled Article template looks like this:
Please note in Scroll PDF Exporter v4.10 (and later versions,) the behaviour mentioned above does not occur. Please see the related v4.10 documentation for further details.
Alternatively, if you were to adjust the column widths for the tables on your Confluence page, width values for the columns will be added to the HTML code in the page storage format:
Once this has been performed, the table in the export will use the whole width of the PDF page (with the relative Confluence column width still being applied):
How Fixed Width tables are handled
In order to export tables that only take up the amount of space in the PDF export, relative to what is shown in the Confluence online view, you can apply the Fixed Width table format.
The table below has the Fixed Width format applied:
This results in the following table being rendered in the PDF export when using the bundled Article template:
In this export example, the column widths rendered in the PDF match those in the Confluence online view.
However, due to the font and table padding settings applied in the the export template, the header text remains on one line and is not wrapped like in the Confluence page view. This is because the bundled Article export template applies a different font style and size in comparison to what is displayed in the Confluence editor.
Unexpected export results
When exporting table content, generated PDF exports may sometimes not appear as expected. This can be caused by different factor but it is important to consider that;
- the online Confluence page view offers more space in a dynamic view (scrollable browser), which differs to the defined space set in a PDF file. Therefore, word/line breaks have to occur in PDF exports so that content does not run off the page.
- browsers can display HTML content differently, for instance rendering fonts wider than what the export will render.
Incorrect word breaks in table cells
Incorrect word breaks can occur in exported tables, irrespective of the format applied (ie. Responsive or Fixed Width). For instance, a Confluence page could look like this:
But the export with the bundled Article template looks like this:
This export behavior occurs because of;
- the number of columns included in the table
- the size of the font used for the table cell content
- the amount of table padding applied to the table header/body cells
In order to prevent this export behavior from occurring you can reduce the size of the font and/or table cell padding in the export template.
Alternatively, you can add the Scroll Table Layout macro prior to the affected table on your Confluence page to modify how the specific table is exported – such as changing the page orientation or defining the specific table column widths.
Template styling not applied
Sometimes formatting not defined in the export template can be rendered in the export. Most notably, this can occur if the table was imported into Confluence, such as via copying and pasting from an external source. In such cases, hidden code from the external source can be retained in the storage format of the Confluence page and cause unexpected export results.
For instance, the table may appear normally in the Confluence online page view:
But when the export is performed, the desired blue table header cell background from the template is not applied to all header cell elements – the header text content incorrectly displays a grey background:
This is caused by hidden HTML background color codes being applied to the header cell text:
To fix this, and similar styling issues, you can either;
- re-add the table content using the standard Confluence editor tool
- use the free Confluence Source Editor to edit the page storage format.
- use the Clear formatting function in the Confluence Editor and re-apply your style