How to print just print output without table's lines and without header?


I have a query that returns value 83. Is it possible not to print table and heading and just show expected output, i.e. 83?

2 answers

1 accepted

1 vote
Answer accepted

Hi Pavel,

Thank you for using PocketQuery!

Of course, it is possible to omit the table heading. You will first need to create your own custom template. Templates are used to define how the result set should be displayed. After that, go to your query and change the used "template" to the one you just created.

A simple template, that displays the usual table without the header, would look like this:

<table class="pocketquery-table confluenceTable">
#foreach ($row in $result)
<tr class="#if($velocityCount % 2 != 0)odd#{else}even#end">
#foreach ($column in $row)
<td class="col-$velocityCount">$!column</td>

If you want to print only the bare result value itself, without any table or other surrounding HTML, you could use the following template. It makes the most sense if there is only one single result value. The first line removes the div container, that normally wraps all rendered PocketQuery macros.

## @param plain:true
#foreach ($row in $result)
#foreach ($column in $row)

There is a lot you can do with templates. We included different examples in the PocketQuery documentation (templating is the last tab), I encourage you to have a look at them.

Hope this helps! Please let me know, if you have more questions.

Thank you dear Carla!

After applying you second solution I was able to insert pocketquery macro directly to table.


However this seems to break total sum row calculation but in this case it's not a big deal.

It should be possible even shorter like this, assuming your column name is "Ektos":

## @param plain:true

Question: how do you do your sum calculation?

Hi Pavel,

You can filter this table by default using Table Filter macro.

Might work, but I would not recommend it because PocketQuery has its own filtering abilities that should perform much better than filtering the table with JS afterwards.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

1,627 views 4 13
Read article

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