How to make column appear when condition satisfied in jinja2 templating

I have a table, where some column are condition specific. I want if the condition is satisfied only then show the column, otherwise, remove the column. How can i do that with jinja2 templating?

Here is an example. Just use the IF-Condition within the column to decide how to fill the column:

{% for drink in drinks %}
 <td>{{ }}</td>
 {% if drink.empty %}
 {% else %}
 {% endif %}
Back to Top