> For the complete documentation index, see [llms.txt](https://guide.docmaker.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.docmaker.co/features/create-pdf-from-docx-template/build-your-docx-template/loops/loops-in-columns-+-lines-grids.md).

# Loops in columns + lines (grids)

If you have a list of items which you want to display in multiple columns and multiple lines, you may use our columns features.

{% hint style="info" %}
The beauty of it, is that page numbers will increment automatically, and page breaks will be perfectly fitted !&#x20;
{% endhint %}

Example data :

&#x20;

```plaintext
{"images": [
 {
   "title": "Shirt",
   "image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTjHWwPvOYKj1hg5y1UdGQw1RbG9HpKwpOZmw&s",
   "description" : "red, long sleeves"
 },
 {
   "title": "Dress",
   "image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTjHWwPvOYKj1hg5y1UdGQw1RbG9HpKwpOZmw&s",
   "description" : "blue and green"
 },
 {
   "title": "trousers",
   "image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTjHWwPvOYKj1hg5y1UdGQw1RbG9HpKwpOZmw&s",
   "description" : "blue jeans"
 }
]
}
```

&#x20;In your template, you have to add Col1, Col2, Col3 to each one of your variables, as shown below:

| <p>{#images}{%imageCol1}</p><p>{titleCol1}</p><p>{descriptionCol1}</p> | <p>{%imageCol2}</p><p>{titleCol2}</p><p>{descriptionCol2}</p> | <p>{%imageCol3}</p><p>{titleCol3}</p><p>{descriptionCol3}{/images}</p> |
| ---------------------------------------------------------------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------- |

\
And in addition to that you have to provide the number of columns in the plugin JSON data, like this:    "images.nbColumns" :3,\
Then just create your JSON loop as usual.\
You can see a demo on this page : <https://docxtopdfplugintest.bubbleapps.io/version-test/image_loop?debug_mode=true>\
Editor: <https://bubble.io/page?type=page&name=image_loop&id=docxtopdfplugintest&tab=tabs-2>

<table data-header-hidden><thead><tr><th></th><th width="78.33333333333331"></th><th></th></tr></thead><tbody><tr><td><strong>Template</strong></td><td> </td><td><strong>Result</strong></td></tr><tr><td></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></p><p> </p></td><td><img src="/files/Jwu6GJcJzs9vpEP7MKKa" alt="" data-size="original"></td></tr></tbody></table>

&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://guide.docmaker.co/features/create-pdf-from-docx-template/build-your-docx-template/loops/loops-in-columns-+-lines-grids.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
