Skip to content
Advertisement

How to change datatable show entry position

I want to change datatable show entry position in my project by default it is on top left but i want to bottom right.

this is my datatable position code:

$('#ebayebuygumm').DataTable({
    "sDom": 'Lfrtlip',
    "columnDefs": [
        { 
            "targets": [0,-1], //first column / numbering column
            "orderable": false, //set not orderable
        },
    ],
    "lengthMenu": [[10, 50, 100, 250], [10, 50, 100, 250]],
    "order": [[ 2, "asc" ]]
});

Advertisement

Answer

    $('#ebayebuygumm').DataTable({
                     "sDom": '<"top"f>rt<"bottom"pli>',
                    "columnDefs": [
            { 
                "targets": [0,-1], //first column / numbering column
                "orderable": false, //set not orderable
            },
            ],
                     "lengthMenu": [[10, 50, 100, 250], [10, 50, 100, 250]],
                     "order": [[ 3, "asc" ]]
                });

and also this css
#ebayebuygumm_paginate{
    float: right;
}
#ebayebuygumm_length{
    float: right;
    margin-right: 12px;
}

“sDom”: ‘<“top”f>rt<“bottom”pli>’,

by this you can change position of dom

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement