Search code examples
jquerydomdatatablesposition

Datatables DOM positioning


Is there any more documentation about DOM positioning other than here? https://www.datatables.net/examples/basic_init/dom.html

For example, I want to position the entries select field & the entries info under the pagination. How would I achieve this?

This is what I got so far:

$("#relations-table").dataTable({
    "order": [[ 1, "desc" ]],
    columnDefs: [ { "orderable": false, "targets": [0] } ],
    //pageLength: 50
    "dom": '<"top"rf>t<"bottom"pli>'
});

$(".dataTables_length").css({ "margin-top": "-35px" });

Solution

  • Found the solution:

     dom:
        "<'row'<'col-sm-6'B><'col-sm-6'f>>" +
        "<'row'<'col-sm-12'tr>>" +
        "<'row'<'col-sm-4'i><'col-sm-4 text-center'l><'col-sm-4'p>>",