1<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0"> 2 <thead> 3 <tr> 4 <th>Name</th> 5 <th>DNS</th> 6 <th>IP Address</th> 7 <th>Contact</th> 8 <th>Location</th> 9 </tr> 10 </thead> 11</table> 12 13<script type="text/javascript"> 14$(document).ready(function() { 15 var table = $('#data-table').dataTable({ 16 "deferRender": true, 17 "data": [% results | none %], 18 "columns": [ 19 { 20 "data": 'ip', 21 "render": function(data, type, row, meta) { 22 return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.name || row.ip) + '</a>'; 23 } 24 }, { 25 "data": 'dns', 26 "render": function(data, type, row, meta) { 27 return he.encode(data || ''); 28 } 29 }, { 30 "data": 'ip', 31 "render": function(data, type, row, meta) { 32 return he.encode(data || ''); 33 } 34 }, { 35 "data": 'contact', 36 "render": function(data, type, row, meta) { 37 return he.encode(data || ''); 38 } 39 }, { 40 "data": 'location', 41 "render": function(data, type, row, meta) { 42 return he.encode(data || ''); 43 } 44 } 45 ], 46[% INCLUDE 'ajax/datatabledefaults.tt' -%] 47 }); 48}); 49</script> 50