<div class="table-responsive">
    <div class="d-flex justify-content-between mb-3 align-items-center">
        <button class="btn btn-dark" onclick="copyTableJsonToClipboard('selftools-config-query-results-rows')">
            Copy as JSON
        </button>
    </div>
    <table id="selftools-config-query-results-rows" class="table table-striped table-bordered table-hover">
        <thead class="table-light">
            <tr>
                <th scope="col">{{ _('key') }}</th>
                <th scope="col">{{ _('value') }}</th>
            </tr>
        </thead>
        <tbody>
            {% for row in data.results %}
            <tr>
                <td>{{ row.key }}</td>
                <td>{{ row.value }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>

<script>
    var dataTable =  new DataTable('#selftools-config-query-results-rows', {
        layout: {
          topStart: {
              pageLength: {
                  menu: [ 10, 25, 50, 100, 1000, 10000 ]
              },
          },
          topEnd: {
            searchBuilder: {},
              search: {
                  placeholder: 'Search here'
              }
          },
        }
    });
</script>
