# vsplit\_in

Source: https://zotonic.com/docs/1947/vsplit_in

URI: https://zotonic.com/id/1947

Language: en



This filter splits a list in shorter lists. It splits an array in N sub-arrays of more or less equal length. This is useful when displaying a list of items in columns.

Note that it splits the array in a different way than <a href="/id/doc_template_filter_filter_split_in" class="doc-reference doc-reference-filter"><code>filter#split_in</code></a> does: The filter split\_in takes alternating elements from the array, where vsplit\_in takes complete runs at a time. See the example below.

For example:

```django
{% with [1,2,3,4,5,6]|vsplit_in:3 as a,b,c %}
    {% for n in a %}{{ n|format_number }} {% endfor %}
{% endwith %}
```

This displays `1 2`. The variable b will be `[3,4]` and the variable c will be `[5,6]`.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1947?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1947?language=en>)
