Forums

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

How to export Confluence pages in landscape format

Hi guys!

Today I stumbled across a solution for a long term problem that we had at my team, so I decided it would be nice to share it here in the community as my first article.

For context, my team uses Confluence as main wiki and document tool. So, from time to time in our projects we have to export pages to send it to people outside our organization. It happens that we use tables a lot, because keeps everything centralized in the page.

Today I had enough! My table was gorgeous in the page, but when I hit export my columns got thinner than a runway model.

I did a little research (https://support.atlassian.com/confluence-cloud/docs/customize-exports-to-pdf/) and found that you can actually manipulate the CSS for the export of the page. Go to Space settings -> Appearance -> PDF stylesheet.

To export the pages in landscape format we can simply add:

@media print {  @page {  size: A4 landscape;  } }

It will apply to all pages in the space.

In my case this was not enough. So I got the page HTML and search for the table element and class to see what I had to add to the stylesheet and end up testing a lot of definitions (many pages were exported, lol).

As a result I got the following CSS applied and it worked fine.

@media print {
@page {
size: A4 landscape;
margin: 20mm;
}

.pm-table-container,
.pm-table-wrapper,
table[data-testid="renderer-table"] {
width: 100% !important; /* Forces full-width table rendering */
max-width: 100% !important;
overflow-x: visible !important;
}

table[data-testid="renderer-table"] {
table-layout: auto !important; /* Allows columns to size based on content */
border-collapse: collapse !important;/* Merges cell borders for cleaner look */
}

col[style],
th[style],
td[style] {
width: auto !important; /* Removes fixed inline column widths */
max-width: none !important; /* Allows cells to expand as needed */
}

th,
td {
white-space: normal !important; /* Enables line wrapping in cells */
word-wrap: break-word !important; /* Breaks long words to prevent overflow */
}

table,
tr,
td,
th {
page-break-inside: avoid; /* Prevents tables or rows from breaking across pages (may cause large white gaps) */
}

body {
overflow-x: visible; /* Ensures the full width of the body is shown */
}
}

If you ever need it, here it is!

 

9 comments

Andrew Zimmerman
Community Champion
May 9, 2025

Thanks for sharing this, @Ana Vitória Selista

Like Ana Vitória Selista likes this
Patricia Modispacher _K15t_
Contributor
May 10, 2025

Hey @Ana Vitória Selista !

Welcome to the gang! Nice to have you! 🎶

And thanks for sharing your Use Case. Super helpful for anyone trying to get more control on their PDF exports. ☺️

I recently joined K15t, so this is a slightly biased hint now: I love their tool Scroll PDF Exporter.

With it, you don't have to tweak any CSS manually. It lets you export pages in landscape or portrait with just a few clicks. You can also apply custom templates with styled headers. 

It's especially handy when you're regularly exporting documentation for external audiences.

Just thought I'd drop the nudge here, just in case it saves someone the CSS trial-and-error-rabbit-hole in the future! ✌🏻

Like Shannon Meehan _K15t_ likes this
Izabela França
Community Champion
May 10, 2025

Super helpful!! Thanks for sharing, @Ana Vitória Selista . 

Like Ana Vitória Selista likes this
Michiel Schuijer
Contributor
May 12, 2025

Excellent article, thanks for sharing!

Like Ana Vitória Selista likes this
Sean Sweeney
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 12, 2025

Thanks @Ana Vitória Selista

This could fix one immediate pain point we've been having and opens up a whole bunch of other possibilities.

Like Ana Vitória Selista likes this
Kit Mitchell
Contributor
May 12, 2025

Ah! Squee! Thank you so much for sharing this :)

Like Ana Vitória Selista likes this
Tanya Christensen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 19, 2025

thinner than a runway model

LOL 



Thank you @Ana Vitória Selista for sharing this.  Very helpful!!

Nicole Learn
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 2, 2025

I really need to fix this, but when I follow your instructions: Go to Space settings -> Appearance -> PDF stylesheet. I don't see Appearance or PDF stylesheet to select. You can seen an image of the options I see in Space Settings. PDF export only allows you to add a Header or Footer title. Furthermore, where do you type in all that code? I don't see anywhere to type in code to get it to format in landscape?confluence Space Settings.png

Tanya Christensen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 2, 2025

@Nicole Learn ,

Per, Customize layout for PDF exports in Confluence Cloud , It's PDF Export from the Settings, once you're there it's the PDF stylesheet section.

 

Setting the PDF layout at space level:

  1. Go to the space in Confluence Cloud.

  2. Next to your space's name in the sidebar, select More actions (•••), then Space settings.

  3. Open the Look and Feel menu and select PDF export

    1. You'll need space admin permission to do this. 

  4. Add HTML to customize the Title, Header, and/or Footer fields.

    1. You can include inline CSS in the HTML.

  5. Select Save.


Step 4 above should also note PDF stylesheet

 

pdf-stylesheet.png

------

 

In Data Center, Customize Exports to PDF , it's PDF Stylesheet

To change the PDF stylesheet for a specific space:

  • Go to the space and choose Space tools > Look and Feel from the bottom of the sidebarYou'll need Space Admin permissions to do this. 
  • Choose PDF Stylesheet.
  • Choose Edit, then add your CSS.

 

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events