pagination position??

pagination position??

rossmurphyrossmurphy Posts: 1Questions: 0Answers: 0
edited March 2010 in General
Is there a method of displaying pagination at the top and bottom of the table??

Replies

  • talkitivewizardtalkitivewizard Posts: 30Questions: 0Answers: 0
    Yes...
    you are going to want to look a sDom here http://www.datatables.net/usage/options

    So the jist of the idea is you want to do something like:
    [code]
    $(document).ready(function() {
    $('#example').dataTable( {
    "sDom": '<"top"ip>rt<"bottom"fl><"clear">'
    } );
    } );
    [/code]
    The following options are allowed:
    'l' - Length changing
    'f' - Filtering input
    't' - The table!
    'i' - Information
    'p' - Pagination
    'r' - pRocessing

    So in other words.. where ever you put "p" in your sDom you will get your pagnation. Additionally, you may need to style it to float the way you want to.
    you will be able to do that by changing the style to
    ID: YOUR_TABLE_ID_HERE_paginate
    CLASS: dataTables_paginate

    Hope this helps you out.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You can put the 'p' option in twice, for example if you want it at the top and the bottom of the table :-)
    http://datatables.net/examples/advanced_init/dom_multiple_elements.html

    Allan
  • talkitivewizardtalkitivewizard Posts: 30Questions: 0Answers: 0
    opps I read that wrong... thought he said top instead of bottom. My bad :P
This discussion has been closed.