How can I add a range to this jQuery pagination?
<p>I am using this jQuery table pagination script and I like to add a range instead of all the page numbers. </p>

<p>So instead of <code>[1][2][3][4][5][6][7]</code>
i like something <code>[1][2][3][&gt;][last]</code></p>

<pre><code>function paginateIt() {
$("#pagination-ajax").remove();
  $('table#overviewJobs').each(function() {

    var currentPage = 0;
    var numPerPage = 7;
    var $table = $(this);

    $table.bind('repaginate', function() {

        $table.find('tbody tr').show()

                .slice(0,currentPage * numPerPage)
                .hide()
                .end()

                .slice((currentPage + 1) * numPerPage)
                .hide()
                .end();

          });

    var numRows = $table.find('tbody tr').length;
    //alert("Num of rows "+numRows);
    var numPages = Math.ceil(numRows / numPerPage);

    var $pager = $('&lt;div id="pagination-ajax"&gt;&lt;/div&gt;');

    if(numRows &gt; numPerPage) {
        for (var page = 0; page &lt; numPages; page++) {
          $('&lt;span class="page-number"&gt;' + (page + 1) + '&lt;/span&gt;')
           .bind('click', {'newPage': page}, function(event) {
             currentPage = event.data['newPage'];
             //numPerPage = 7;
             $table.trigger('repaginate');
             $(this).addClass('active').siblings().removeClass('active');
           })
           .appendTo($pager).addClass('clickable');
        }
        $pager.find('span.page-number:first').addClass('active');
        $pager.insertAfter($('#pagination-divider'));
    } //end if numRows
    //
    //$('#pagination').html(navigation_html);
    $table.trigger('repaginate');

  });
};
</code></pre>
