Forums

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

Show x-last columns of a confluence table

Jan Szczepanski October 11, 2017

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
Answer accepted
Jan Szczepanski October 13, 2017

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
Andrey Khaneev _StiltSoft_
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.
October 11, 2017

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.

1 vote
Thomas Schlegel
Community Champion
October 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

Jan Szczepanski October 11, 2017

Moin Thomas,

I'll try that one, thanks!

Beste Grüße zurück ;)

Jan

Davin Studer
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.
October 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.

Jan Szczepanski October 13, 2017

Thanks Davin, exactly that worked for me.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events