Jinja has a "center" formatting option, but how about "right align"?

{{ key.rjust(20) }}:{{value}} did the trick

I did not know you could just call python string commands from the box. If someone has a more "jinja" solution, using pipes, I will give the answer to that.


Use the build-in Jinja2 filter called format. For example:

Left aligned string of width 20:

{{ "%-20s"|format(variable) }} 

Right aligned string of width 20:

{{ "%20s"|format(variable) }}

Your case:

{{ "%20s:%s"|format(key, value) }}

Tags:

Python

Jinja2