<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0"> <thead> <tr> <th>Channel</th> <th>Count</th> </tr> </thead> </table> <script type="text/javascript"> $(document).ready(function() { var table = $('#data-table').dataTable({ "deferRender": true, "order": [[ 1, "desc" ]], "data": [% results | none %], "columns": [ { "data": 'channel' }, { "data": 'ch_count', "searchable": false, "render": function(data, type, row, meta) { return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } } ], [% INCLUDE 'ajax/datatabledefaults.tt' -%] }); }); </script>