Example

This table:

a

b

c

d

e

f

g

h

i

Should become this:

a

d

g

b

e

h

c

f

i

How To

  1. Go to the PocketQuery Administration

  2. Go to "Templates" and click on "Add template"

  3. Name it "pivot" and copy & paste following code into "content"

    <table class="aui confluenceTable pocketquery-table">
        <tbody>
        #foreach ($column in $columns)
            <tr>
                <td style="background-color: #f0f0f0; font-weight: bold;">
                    $column
                </td>
                #foreach($row in $result)
                    <td>
                        $!row.get($column)
                    </td>
                #end
            </tr>
        #end
        </tbody>
    </table>
    CODE
  4. Go to a query and select "pivot" as template