Search code examples
csstwitter-bootstrapdatatables

Display page length and pagination in the same line jquery dataTables


Is there any way to display the page-length option and paginate option in the same line? This is how I got:

enter image description here

Is there any way to override their css and display them in the same line? They both are in two separate div. I've added "jquery.dataTables.min.css" and "bootstrap.min.css".


Solution

  • Use dom option to construct the layout for Bootstrap framework.

    var table = $('#example').DataTable({
        dom: "<'row'<'col-sm-12'tr>>" +
             "<'row'<'col-sm-4'l><'col-sm-8'p>>"
    });
    

    See this jsFiddle for code and demonstration