Skip to main content
Skip table of contents

How to make a PocketQuery table only take the space it needs (and not the full width of the page)

Using a new template

  1. Go to the PocketQuery Administration

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

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

    CODE
    <table class="aui confluenceTable pocketquery-table" style="width: auto;">
        <thead>
            <tr>
            #foreach ($column in $columns)
                <th style="white-space: nowrap;">$!column</th>
            #end
            </tr>
        </thead>
         
        <tbody>
            #foreach ($row in $result)
                <tr>
                #foreach ($column in $row)
                    <td>$!column</td>
                #end
                </tr>
            #end
        </tbody>
    </table>
  4. Go to your Query and select "auto_resizable_table" as its Template

Using an existing template

Modify your template by adding a style="width: auto;" attribute to your table like this:

CODE
<table class="aui confluenceTable pocketquery-table" style="width: auto;">
  ...
</table>

Example

Default Template without style="width: auto;"

Modified Template including style="width: auto;"

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.