I'm trying to create a table inside a modal window that is triggered / opened as the user clicks a button, but due to having too many records it's slow to open so I thought about paging. Could someone show me some example?
<!-- INICIO DA JANELA MODAL -->
<div class="modal fade" id="Modal_afil" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<label class="modal-title">Afiliada</label>
</div>
<div class="modal-body">
<div class="container theme-showcase" role="main">
<div class="page-header">
<div class="row"><!-- Inicio Cria DIV para efetuar pesquisa dos registros -->
<div class="col-sm-6 col-md-6">
<form id='ajax_form' class="form-inline ajax_form" method="GET" action="pesquisar_1.php">
<div class="form-group">
<label for="exampleInputName2">Pesquisar</label>
<input type="text" name="pesquisar" class="form-control" id="exampleInputName2" placeholder="Digitar...">
</div>
<button type="submit" class="btn btn-primary">Pesquisar</button>
</form>
</div>
</div><!-- Fim Cria DIV para efetuar pesquisa dos registros -->
<!-- Inicio da Paginacao de Resultados -->
<nav class="text-center">
<?php
//Verificar a pagina anterior e posterior
$pagina_anterior = $pagina - 1;
$pagina_posterior = $pagina + 1;
?>
<ul class="pagination">
<li>
<?php
if($pagina_anterior != 0){ ?>
<a href="index.php?pagina=<?php echo $pagina_anterior; ?>" aria-label="Previous">
<span aria-hidden="true">«</span>
</a>
<?php }else{ ?>
<span aria-hidden="true">«</span>
<?php } ?>
</li>
<?php
//Apresentar a paginacao
for($i = 1; $i < $num_pagina + 1; $i++){ ?>
<li><a href="index.php?pagina=<?php echo $i; ?>"><?php echo $i; ?></a></li>
<?php } ?>
<li>
<?php
if($pagina_posterior <= $num_pagina){ ?>
<a href="index.php?pagina=<?php echo $pagina_posterior; ?>" aria-label="Previous">
<span aria-hidden="true">»</span>
</a>
<?php }else{ ?>
<span aria-hidden="true">»</span>
<?php } ?>
</li>
</ul>
</nav>
<!-- Fim da Paginacao de Resultados -->
<!-- Inicio Tabela com registros que aparece dentro do Modal -->
<div class="row">
<table class='table table-bordered' class='pagination'>
<thead>
<tr>
<td><b>Código</b></td>
<td><b>Nome Fantasia</b></td>
<td><b>Codigo Interno</b></td>
<td><b>Nome / Razão Social</b></td>
<td><b>Endereço</b></td>
</tr>
</thead>
<?php while($rows_cursos = mysqli_fetch_assoc($resultado_cursos)){ ?>
<tbody>
<tr class='btn-default'>
<td class='get-cadcli'><?php echo $rows_cursos['codigo']; ?></td>
<td class='get-value-cadcli'><?php echo $rows_cursos['nome_fantasia']; ?></td>
<td class='get-value-cadcli'><?php echo $rows_cursos['codigo_interno']; ?></td>
<td class='get-value-cadcli'><?php echo $rows_cursos['cliente']; ?></td>
<td class='get-value-cadcli'><?php echo $rows_cursos['nome_logr']; ?></td>
</tr>
</tbody>
<?php } ?>
</table>
</div>
<!-- Inicio Tabela com registros que aparece dentro do Modal -->
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
</div>
</div>
</div>
</div>
<!-- FIM DA JANELA MODAL -->