How to fix the relative width of table columns when exporting a page to pdf?

ABoerio August 18, 2020

Hello,

I'm trying to configure a proper pdf stylesheet in Confluence, and I'm not getting to a solution.

Given a table, which turns out to have the following storage format 

<table class="wrapped fixed-table"><colgroup><col style="width: 136.0px;" /><col style="width: 267.0px;" /><col style="width: 125.0px;" /></colgroup>

I'd like to get the same column proportion when exporting to pdf.

I'd like to have the total width of the table to fill the available width of the page, and to have the width of the columns with the same relative dimension.

First column width should be set to (136/(136+267+125))% of the table width.

I'm quite a newbie with CSS, so I wonder if there's a simple way to get this done.

I'm not finding a way to control this proportion.

Thanks in advance for any hint.

Ciao, Andrea.

 

2 answers

1 vote
ABoerio July 15, 2022

As an update for those ones who might be reading, in the end the only solution we found was to adopt this plugin

https://marketplace.atlassian.com/apps/24982/scroll-word-exporter-for-confluence?tab=overview&hosting=server

which actually works very well.

Before a table you can place a specific macro where you can set the width of each colum of the next table, each column in terms of % of the whole page width.

This macro will be read when exporting.

For us it works very well.

Ciao, Andrea

0 votes
Joshua Sneed Contegix
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 18, 2020

Hi Andrea,

Check out Atlassian's Customize Exports to PDF and Advanced PDF Export Customization pages for information on managing stylesheets. Cheers!

ABoerio August 19, 2020

Hello @Joshua Sneed Contegix and thanks for your answer.

I had actually already read those pages, but didn't find anything that works for me.

I don't need to set the table width, as to me it's OK to have it using all the available page width.

It seems like the only change I could add is to say to fix all the columns to the same width, and force images to be resized in case of need.

Or, as it works by default, I can leave the automatic definition of the table columns, and in this way the exporter seems to try to follow the proportions set by the user, up to when it's possible to some how fit the content.

It's not clear to me the criteria used to define the column width.

As a basic behaviour, I'd like the exporter to read the proportions set by the user and create a table that covers the whole page width, recreating the same column width proportions, regardless if it is a repsonsive or fixed table, and regardless if this means that a row becomes very high. Images should be resized, if needed, and that would be all.

Then I could try to play a bit more with text styling.

Is there something I'm missing?

:-(

Ciao, Andrea

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events