$.ajax({
type: "POST",
url: "php/crud.php",
dataType: "json",
data: {qtd_registros: 3, pagina: 1},
success:function(dados){
var paginacao = '<nav><ul class="pagination justify-content-center"><li class="page-item"><a class="page-link" href="index.html?pagina=0" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>';
for(var i=0;i<dados.num_paginas;i++){
if(pagina == i){$('#pag').addClass("active");}
var soma = parseInt(1) + i;
paginacao += '<li class="page-item" <a class="page-link" href="index.html?pagina='+i+'">'+soma+'</a></li>';
}
var links = dados.num_paginas - 1;
paginacao += '<li class="page-item"><a class="page-link" href="index.html?pagina='+links+'" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li></ul></nav>';
$('table').after(paginacao);
}
});
In this case the links the number of links are generated by not as links, somehow I do not know why when I check the bootstrap 4.1 class="page-link" p>
As it does not have the class in the link it appears as a text.