1<table id="rg-data-table" class="table table-bordered table-condensed table-striped" width="100%" cellspacing="0"> 2 <thead> 3 <tr> 4 [% FOREACH hdr IN headings %] 5 <th>[% hdr | html_entity %]</th> 6 [% END %] 7 </tr> 8 </thead> 9 <tbody> 10 [% FOREACH row IN results %] 11 <tr> 12 [% FOREACH col IN columns %] 13 [% IF column_options.$col._searchable %] 14 <td> 15 <a href="[% uri_for('/search') | none %]?q=[% row.item(col) | uri %]">[% row.item(col) | html_entity %]</a> 16 </td> 17 [% ELSE %] 18 <td>[% row.item(col) | html_entity %]</td> 19 [% END %] 20 [% END %] 21 </tr> 22 [% END %] 23 </tbody> 24</table> 25 26<script> 27$(document).ready(function() { 28 $('#rg-data-table').dataTable({ 29 "order": [], 30[% INCLUDE 'ajax/datatabledefaults.tt' -%] 31 } ); 32} ); 33</script> 34