[Answer]-How to take at template table one time photo next time string value

1👍

Your {{ value }} for that second element should be a path (relative or absolute) to an image resource. If this data is defined by a model within your Django project, make sure the field is set correctly in models.py–it should be a FileField or ImageField. With those, you get a callable URL property. Then in your template, something along these lines:

<table>
{% for row in data%}
    <tr>
    {% for value in row %}

        {% if value.url %}
            <td><img src="{{ value.url }}" alt="..."></td>
        {% else %}
            <td>{{ value }}</td>
        {% endif %}

    {% endfor %}
    </tr>
{% endfor %}
</table>

Leave a comment