{% fragment as default_content %} {% load randomid %} {% for td in data %} {% if forloop.first %} {% randomid td as th_popover_id %} {{ td|truncatechars:30 }} {% if td|length > 30 %} {% #popover id=th_popover_id %} {{ td }} {% /popover %} {% endif %} {% else %} {% #table_td %} {{ td }} {% /table_td %} {% endif %} {% endfor %} {% endfragment %} {{ children|default:default_content }}