{% for session in table %}
    <p><strong>Session {{ forloop.counter0|add:starting_session_index }}</strong></p>
    {% for sheet in session %}
        <div>
            {% if sheet %}
                <p><a href="{% url 'materials_viewer' pdf_name=sheet.url_name %}">{{ sheet.url_name }}</a></p>
            {% endif %}
        </div>
    {% endfor %}
{% endfor %}
