{% macro table(model) -%}

    <link href="{{ url_for('public', path='vendor/DataTables/css/dataTables.bootstrap5.'+minify+'css') }}" rel="stylesheet"/>

    <table id="dt" class="table table-striped" style="width:100%">
        <thead>
        <tr>
            {% for field in model.field_input_map() %}
                {% if not field.endswith('_id') %}
                    <th>{{ field }}</th>
                {% endif %}
            {% endfor %}
        </tr>
        </thead>
    </table>

    <script defer src="{{ url_for('public', path='vendor/DataTables/js/jquery.dataTables.'+minify+'js') }}"></script>
    <script defer src="{{ url_for('public', path='vendor/DataTables/js/dataTables.bootstrap5.'+minify+'js') }}"></script>
    <script>
        document.addEventListener("DOMContentLoaded", function () {
            new DataTable('#dt', {ajax: '/dt/{{ model.__name__ }}'})
        });
    </script>

{%- endmacro %}
