This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.

Table-plus macro

Name Table-plus Macro
Download See Table Plugin
Issue Tracking http://developer.atlassian.com/jira/browse/TBL

Description


Adds column sorting and other attributes to one or more tables found in the body of the macro. The tables can be produced by wiki markup or other means. Clicking on a column heading will cause that column to be sorted. Clicking again will reverse the order. Note that the excel, csv, or sql macros already have most of these capabilities.

Documentation

Parameters

In addition to the parameters listed below, this macro supports Common table capabilities.

  • heading - Number of rows to be considered heading rows (default is 1 row). Specify heading=false or heading=0 to not show any heading lines. Heading rows do not participate in sorting.
  • border - The border width in pixels. Defaults to normal table border width.
  • width - The table width in pixels. Default is 100%.
  • Other parameters - Other parameters, such as 'cellspacing' or 'cellpadding', are passed through to the html table markup for more advanced capabilities,
    or to override the default class.

Live Examples

Sort by clicking heading column
1. Simple wiki table
Result
  January February March April
Max 37.5 32.7 28.0 25.3
Min 31.3 26.8 25.1 18.7
Source
{table-plus}
|| || January || February || March || April ||
| Max | 37.5 | 32.7 | 28.0 | 25.3 |
| Min | 31.3 | 26.8 | 25.1 | 18.7 |
{table-plus}
2. Simple totals
Result
Fish Type 2004 2005
Herring 9500 8300
Salmon 2900 4200
Tuna 1500 1500
Source
{table-plus:autoTotal=true|autoNumber=true|sortColumn=2|sortIcon=true|columnTypes=S,I,I}
|| Fish Type || 2004 || 2005 ||
|| Herring    | 9500  | 8300 |
|| Salmon     | 2900  | 4200 |
|| Tuna       | 1500  | 1500 |
{table-plus}
3. Change how table looks
Result

2006

Month Max Min Average
January 25.5 6.3 15.9
February 32.4 12.8 22.6
March 44.6 24.5 34.6
April 59.7 37.1 48.4

2007

Month Max Min Average
January 23.4 6.1 14.9
February 31.4 12.9 21.8
March 43.6 24.5 34.6
April 58.7 36.1 45.4
Source
{table-plus:border=0|align=center|cellspacing=0|cellpadding=10|class=''|title='Monthly temperatures'|
            highlightColor=white|bgcolor=silver|columnTypes=S,F,F,F|
            columnAttributes=style="background:yellow; font-size:12pt; text-align: center;"}

*2006*
|| Month || Max || Min || Average ||
| January | 25.5 | *6.3* | 15.9 |
| February | 32.4 | 12.8 | 22.6 |
| March | 44.6 | 24.5 | 34.6 |
| April | 59.7 | 37.1 | 48.4 |

*2007*
|| Month || Max || Min || Average ||
| January | 23.4 | *6.1* | 14.9 |
| February | 31.4 | 12.9 | 21.8 |
| March | 43.6 | 24.5 | 34.6 |
| April | 58.7 | 36.1 | 45.4 |
{table-plus}

Open Issues with this component

Screenshots


*1 http://confluence.atlassian.com/confluence/renderer/notationhelp.action

Labels

confluence20 confluence20 Delete
confluence14 confluence14 Delete
confluence21 confluence21 Delete
macro macro Delete
plugin plugin Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Apr 11, 2006

    Guy Fraser says:

    Niiiiice

    Niiiiice

  2. Apr 11, 2006

    Jonathan Nolen says:

    This is killer. Can we get some screenshots?

    This is killer. Can we get some screenshots?

  3. Apr 11, 2006

    Guy Fraser says:

    Is it possible to change the row highlight colour?

    Is it possible to change the row highlight colour?

    1. Apr 11, 2006

      Bob Swift says:

      Should have thought of that, write up an issue please!

      Should have thought of that, write up an issue please!

  4. Apr 11, 2006

    Andy Armstrong says:

    This is awesome! I'm planning on updating the Metadata Plugin to optionally gene...

    This is awesome! I'm planning on updating the Metadata Plugin to optionally generate Table-plus macro syntax:

    http://developer.atlassian.com/jira/browse/META-19

    One question I have is about the sorting. I have a lot of complicated sorting logic in the Metadata Plugin for sorting different formats (currently strings, numbers and JIRA-style durations, and I plan on adding dates). I wonder if any of that can be shared by the dynamic sorting. Presumably that would mean rewriting it in Javascript. What do you think?

    1. Apr 11, 2006

      Bob Swift says:

      I think adding dates and jira durations (you mean 1s, 1d, etc.. right?) to the j...

      I think adding dates and jira durations (you mean 1s, 1d, etc.. right?) to the javascript is possible and certainly desirable for all the macros that use it.

    2. Apr 18, 2006

      daren desjardins says:

      I would love to have Date support in the sorting!

      I would love to have Date support in the sorting!

      1. Apr 18, 2006

        Bob Swift says:

        I don't think there is an issue for that yet, could add one and describe any oth...

        I don't think there is an issue for that yet, could add one and describe any other information related to that. Thanks.

  5. Apr 25, 2006

    Russell Warren says:

    General support for adjusting per-column attributes (like width) would be excell...

    General support for adjusting per-column attributes (like width) would be excellent. Something like
    columnWidths=100,50,50,50
    would be nice.

    In general, direct passthroughs to html <col> attributes (similar to what you did with stuff like cellspacing, but with a list) would be very useful.

    Jira'd it here: http://developer.atlassian.com/jira/browse/SCRP-75

    1. Jan 17, 2008

      Olivier Jauze says:

      I tried this columnAttributes=width=20%,width=30%,width=50% and it worked...

      I tried this

      columnAttributes=width=20%,width=30%,width=50%
      

      and it worked well.

      1. Feb 03, 2008

        Jeremy Page says:

        Olivier,  Did you find that modifying the columnAttributes did not render ...

        Olivier,

         Did you find that modifying the columnAttributes did not render properly using Preview, but only when Page was saved and viewed?

        Thanks,

        Jeremy.

      2. Jun 24

        Adam Graffunder says:

        This isn't working for me.  I tried the format you used, both types of quot...

        This isn't working for me.  I tried the format you used, both types of quotes, using absolute values instead of percentages.  No dice.

  6. Jun 14, 2006

    Jeff Hatfield says:

    Is it true that if I use this macro the table can no longer be edited using Rich...

    Is it true that if I use this macro the table can no longer be edited using Rich Text mode features?  Maybe I'm missing something?

    1. Jun 14, 2006

      Bob Swift says:

      True . Rich text editor and macros don't get along very well. You can temporar...

      True . Rich text editor and macros don't get along very well. You can temporarily remove the macro to edit the table with rich text editor and then re-enable it something like:

      \{table-plus ...
      || Month || Max ||
      | January | 25.5 | 
      \{table-plus}
      
      1. Jun 17, 2006

        Jeff Hatfield says:

        Yep, that's a bummer.  I've got a large table that needs to be editied by e...

        Yep, that's a bummer.  I've got a large table that needs to be editied by executive & sales types and I doubt they could deal with the workaround, much less wiki markup.  It's a pity because the table-plus and cache macros would be perfect for this situation.  Is there any hope that Atlassian will find a way to make rich text play nice with macros? Like an option to tell rich text that in this particular situation to allow rich text editing (I wouldn't want it for every macro, like SQL)? 

        1. Jun 23, 2006

          Jeff Hatfield says:

          I came up with a lame workaround for this, but it was kind of amazing that it wo...

          I came up with a lame workaround for this, but it was kind of amazing that it works so I thought I'd share.

          Anyway, I just included the table on another page and wrapped the cache and table-plus macros around the included page. I also put a link pointing to the edit page of the origional.

          {cache}   
          {table-plus}   
          [Edit|https://ourdomain.com/confluence/pages/editpage.action?pageId=6136]     
          {include:Big List}   
          {table-plus}   
          {cache}  
          
  7. Oct 12, 2006

    Neil Arrowsmith says:

    A little bit of cross-posting. I've discovered that table-plus causes the Lozen...

    A little bit of cross-posting.

    I've discovered that table-plus causes the Lozenges provided by the Content Formatting Macros plug-in to behave strangely. Full details are on the comments thread on that page.

    1. Oct 12, 2006

      Bob Swift says:

      Neil, create an issue for the table macros and I will have a look at it.

      Neil, create an issue for the table macros and I will have a look at it.

      1. Oct 15, 2006

        Bob Swift says:

        And I need some specific markup to test since simple testing doesn't show any pr...

        And I need some specific markup to test since simple testing doesn't show any problems.

  8. Oct 19, 2006

    SB says:

    how to disable sorting?

    how to disable sorting?

    1. Oct 12, 2007

      Bob Swift says:

      Set enableSorting=false to prevent sorting.

      Set enableSorting=false to prevent sorting.

  9. Nov 08, 2006

    Limor Maayan says:

    How can I download this macro? Do you have instructions somewhere?

    How can I download this macro? Do you have instructions somewhere?

    1. Nov 08, 2006

      Bob Swift says:

      See top of page.

      See top of page.

  10. Nov 21, 2006

    Tony Bianchino says:

    Is there any way of turning off the table's border thickness? I'd like to get ri...

    Is there any way of turning off the table's border thickness? I'd like to get rid of the lines between my table rows and columns.

  11. Dec 12, 2006

    Robert Senger says:

    Nice plugin, makes tables much more comfortable, as sorting is one of my most of...

    Nice plugin, makes tables much more comfortable, as sorting is one of my most often used operation on tables ... Is there a way to extend the columnTypes with more datatypes, e.g. a userspecific date format like dd.mm.yyyy ? Another useful feature would be if I could make the sorting permanent ...

    1. Dec 12, 2006

      Bob Swift says:

      There are improvements in these areas being implemented and tested right now. P...

      There are improvements in these areas being implemented and tested right now. Please create some specific issues in the issue tracker (link on top of page) to cover your specifics.

  12. Mar 08, 2007

    Bernhard Neuhauser says:

    Please provide a simple mechanism to change the background color on cell level. ...

    Please provide a simple mechanism to change the background color on cell level.

    My best workaround is a small user macro: "<div style='background-color:$param0' />"
    Usage: | {bg:blue}15.23 |

    Disadvantage: The wysiwyg has a problem with macros inside cells. Also it does not color the whole cell (only the area near the text). (The idea comes from the bgcolor macro, but its simply to long: {bgcolor:blue}15.23{bgcolor})

    Nice syntax would be something like:
    | :red 15.23 | (keep it as simple as possible! The whitespace in front of the : comes from the wysiwyg ..)

    1. Mar 08, 2007

      Bob Swift says:

      Please create an issue to track this. I don't have any good ideas at the moment...

      Please create an issue to track this. I don't have any good ideas at the moment. I have also been using the bgcolor macro as you indicated.

  13. Sep 12, 2007

    Ken Young says:

    Do you have any recommendations on hiding columns based on the group(s) a logged...

    Do you have any recommendations on hiding columns based on the group(s) a logged in user is a member of?