Show x-last columns of a confluence table

Hello community,

I'm searching for a way to shorten a confluence table in the "view" mode.

Szenario:

We have some pages with huge confluence tables, lets say 40 columns. But we only want to show the last 10 columns. 

How can I achieve this? 

Info: 

We cannot use the HTML add-on from Bobswift, due to a serious security (XSS) vulnerability witch comes with the Add-on.

Regards,
Jan

3 answers

1 accepted

1 vote
Accepted answer

Dirty but good, we're using an add-on which has a css macro.

td:nth-last-child(+n+6) {
display: none;
}

Works! :)

1 vote
Thomas Schlegel Community Champion Oct 11, 2017

Hi Jan,

I think, this should be possible with a user macro that is filtering columns. I've done something similar, filtering rows with JQuery. Should work with columns too, I think. I've written an article about that here: 

https://community.atlassian.com/t5/Confluence-articles/The-Admin-s-tale-User-Macro-filtering-a-Confluence-table/ba-p/459369

Viele Grüße um die Ecke

Thomas

Moin Thomas,

I'll try that one, thanks!

Beste Grüße zurück ;)

Jan

Davin Studer Community Champion Oct 11, 2017

Using a user macro you could actually do it without having to resort to jQuery. Look into the nth-child CSS selector and display: none.

Thanks Davin, exactly that worked for me.

Hello Jan,

You can use Table Filter macro for this purpose:

  1. Wrap your table with Table Filter macro.
  2. Add a Hide column filter. You can find it easier to add filter while viewing the page.
  3. Choose columns to hide (or set filter inverse and choose columns to show).
  4. Don't forget to save changes.

You can try it right now on the demo site.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,543 views 25 14
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you