<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0"> <thead> <tr> <th>VLAN ID</th> <th>VLAN Name</th> </tr> </thead> </table> <script type="text/javascript"> $(document).ready(function() { var table = $('#data-table').dataTable({ "deferRender": true, "data": [% results | none %], "columns": [ { "data": 'vlan', "render": function(data, type, row, meta) { return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + data + '</a>'; } }, { "data": 'description', "render": function(data, type, row, meta) { return '<a href="[% uri_for('/search') | none %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>'; } } ], [% INCLUDE 'ajax/datatabledefaults.tt' -%] }); }); </script>