<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
  <thead>
    <tr>
      <th class="nd_center-cell">Device</th>
      <th class="nd_center-cell">Address</th>
      <th class="nd_center-cell">Contact</th>
      <th class="nd_center-cell">Location</th>
    </tr>
  </thead>
</table>

<script type="text/javascript">
$(document).ready(function() {
  var table = $('#data-table').dataTable({
    "deferRender": true,
    "data": [% results | none %],
    "columns": [{
        "data": 'ip',
        "render": function(data, type, row, meta) {
          return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.name || row.ip) + '</a>';
        }
      }, {
        "data": 'alias',
        "render": function(data, type, row, meta) {
          return he.encode(data || '');
        }
      }, {
        "data": 'contact',
        "render": function(data, type, row, meta) {
          return he.encode(data || '');
        }
      }, {
        "data": 'location',
        "render": function(data, type, row, meta) {
          return he.encode(data || '');
        }
      }
    ],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
  });
});</script>
