Proper method of padding text

I am trying to print a line of text to a file such that field1 is separated from field2 by 16 characters. I have a template like this working:

{% for item in collection %}
{{ item.name }}{{ " " |truncate(16-(item.name|length)) }}{{ name.value }}
{% endfor %}

So the " " field is 16 spaces, and the longest item.name is 15 chars, so that line should have only one space between it and its item.value, while other lines will have their item.value’s lined up in the same column. This is mostly working, but this is my exact output:

item1 …v01
item02 …v2
the_15-chr_item …v03
item0004 …v04

Where are all the '…'s coming from? When I changed the ‘truncate’ line to ‘truncate(13-(item.name|length)’, I got this:

item1 …v01
item02 …v2
the_15-chr_item…v03
item0004 …v04

Technically correct, but again still with ‘…’. What am I doing wrong?

Furthermore, I can show that it is the ‘truncate’ part itself that is adding the ‘…’:

{% for item in collection %}
{{ item.name }}{{ " " |truncate(16-(item.name|length)) }}:{{ name.value }}
{% endfor %}

Produces the following output:

item1 …:v01
item02 …:v2
the_15-chr_item …:v03
item0004 …:v04

You should check out the jinja2 docs:

http://jinja.pocoo.org/docs/dev/templates/#truncate

truncate will add “…” unless you specify end=‘’

Also you might be able to use the “indent” filter for adding the spacing for you:

http://jinja.pocoo.org/docs/dev/templates/#indent

Thank you. I did read the documentation on truncate, but obviously not closely enough…