Pagination with Bootstrap 3

Pagination with Bootstrap 3

fgeorgesfgeorges Posts: 8Questions: 3Answers: 0
edited November 2013 in General
Hi,

Using the latest stable versions of both DataTables and Bootstrap
(resp. 1.9.4 and 3.0.2), I would like to use a table with pagination.
So I used the following pieces to integrate DataTables with Bootstrap
3, and to enable pagination:

- https://github.com/DataTables/Plugins/tree/master/integration/bootstrap/3
- http://datatables.net/plug-ins/pagination

I also tried the following to adapt the pagination to Bootstrap 3:

http://datatables.net/forums/discussion/16675/twitter-bootstrap-3

Neither test works. See both examples at:

- http://fgeorges.org/tmp/dt-bs-3/test-1.html
- http://fgeorges.org/tmp/dt-bs-3/test-2.html

Any idea what I'm doing wrong, and why the pagination is not enabled?

Regards,

--
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/

Replies

  • allanallan Posts: 63,180Questions: 1Answers: 10,411 Site admin
    Hi,

    Thanks for the links! There is something a little bit funny going on with the page. Based on the fact that the Chrome view source syntax highlighter wasn't displaying your script tags correctly I took a look at the HTTP headers, and while your page is XML, it is being served as HTML:

    > Content-Type: text/html

    I think the problem might be that in combination with the self closing tags. Perhaps try and see if that helps? It doesn't appear that DataTables is being being loaded on your page at the moment.

    Allan
  • fgeorgesfgeorges Posts: 8Questions: 3Answers: 0
    D'oh! Thank you Allan, this is indeed the reason. I'll make sure to
    review the serialisation settings of the XML software I use to
    generate the pages so it serialises as proper HTML. I have updated
    the pages with the correct versions at:

    - http://fgeorges.org/tmp/dt-bs-3/test-1.html
    - http://fgeorges.org/tmp/dt-bs-3/test-2.html

    Thank you! Regards,

    --
    Florent Georges
    http://fgeorges.org/
    http://h2oconsulting.be/
  • fgeorgesfgeorges Posts: 8Questions: 3Answers: 0
    By the way, if this can be of any help, I cleaned up a bit the example, and added an archive to download all the files at once:

    http://fgeorges.org/test/data-tables-bootstrap-3/

    --
    Florent Georges
    http://fgeorges.org/
    http://h2oconsulting.be/
This discussion has been closed.