<table class="table table-sm my-0">
    <tbody id={{ table_id }}>
    {% for form in formset %}
        <tr data-player-id="{{ form.instance.player.id }}"
            data-position="{{ form.instance.position }}"
            data-order="{{ form.instance.order }}">
            {{ form.id.as_hidden }}
            {{ form.event.as_hidden }}
            {{ form.order.as_hidden }}
            {{ form.player.as_hidden }}
            {{ form.teamsnap_id.as_hidden }}

            <td class="col-1">
                <div class="mx-1">
                    <span id="player-order-{{ form.instance.player.id }}">
                {% if form.order.value > 0 %} {{ form.order.value }} {% endif %}
                </span>

                    <span id="player-availability-{{ form.instance.player.id }}" class="{{ available_class }}">
                {% if form.instance.event_availability == 2 %}
                    <i class="bi bi-circle-fill text-success"></i>
                {% elif form.instance.event_availabilitye == 1 %}
                    <i class="bi bi-circle-fill text-info"></i>
                {% elif form.instance.event_availability == 0 %}
                    <i class="bi bi-circle-fill text-danger"></i>
                {% else %}
                    <i class="bi bi-circle-fill text-secondary"></i>
                {% endif %}
                </span>
                </div>
            </td>

            <th>

                {{ form.instance.player.first_name }}&nbsp;{{ form.instance.player.last_name }}&nbsp;
                <small class="text-muted fw-light">#{{ form.instance.player.jersey_number }}</small>
                {#        <br><code><small>{{ form.statline }}</small></code>#}
            </th>
            <td class="col-2">
                {{ form.position }}
            </td>
            <td class="col-1 drag-handle">
                <i class="bi bi-grip-vertical text-secondary"></i>
            </td>
            {#                                    <td>{{ form.instance.position }}</td>#}
        </tr>
    {% endfor %}
    </tbody>
</table>