Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nafeeur10's avatar

DataTable is not working to change Pagination Text

I want to change Pagination Text Previous to Prev

How is this possible?

<table class=" table table-bordered table-striped table-hover datatable datatable-Permission">
    --------
</table>

jQuery Code:

$('.datatable-Permission:not(.ajaxTable)').DataTable({ 
      buttons: dtButtons,
      language: {
        paginate: {
            previous: 'Prev',
            next:     'Next'
        },
        aria: {
            paginate: {
                previous: 'Previous',
                next:     'Next'
            }
        }
    }
})

Not working!!!!

0 likes
5 replies
Sinnbeck's avatar

What version of datatables are you running? This was added in 1.10 I believe

Sinnbeck's avatar

I don't understand what you are saying. What id?

Do you mean it works if you give your table an ID instead of class and use that?

nafeeur10's avatar

@sinnbeck,

Yes.

But separately.

$('.datatable-Permission:not(.ajaxTable)').DataTable({ 
      buttons: dtButtons,
      language: {
        paginate: {
            previous: 'Prev',
            next:     'Next'
        },
        aria: {
            paginate: {
                previous: 'Previous',
                next:     'Next'
            }
        }
    }
})

$("givenIDofTable").DataTable({
 language: {
        paginate: {
            previous: 'Prev',
            next:     'Next'
        },
        aria: {
            paginate: {
                previous: 'Previous',
                next:     'Next'
            }
        }
    }
})

This will work but it is a problem to define two times

Please or to participate in this conversation.