DataTable Dynamic table content
DataTable Dynamic table content
Hi everybody,
Please i have a problem with my datatable pagination: When i put a static data fields, the pagination works correctly , but when i try to get my data from my database the pagination does not work. Iwant to mention that i get my data using "While" without an object as below:
<table class="table table-striped" id="example" class="display">
<thead>
<tr>
<th>Name</th>
```<th>Position</th>```
```<th>Office</th>```
```<th>Age</th>```
```<th>Start date</th>```
```<th>Salary</th>```
``` </tr>```
``` </thead> ```
<?php $reponse3 = mysql_query($sqlTous);
while ($rowMat1 = mysql_fetch_array($reponse3)) { ?>
<tbody class="table table-striped" id="example" class="display">
<tr>
<td><?php echo $rowMat1['SN']; ?></td>
<td><?php echo $rowMat1['NOMENCLATURE']; ?></td>
<td><?php echo $rowMat1['Reference']; ?></td>
<td><?php echo $rowMat1['libelle']; ?> </td>
<td><?php echo $rowMat1['Date_Acquisition']; ?></td>
<td><?php echo $rowMat1['Date_affectation']; ?></td>
</tr>
</tbody>
<?php } ?'''>
</table>
</form>```
<script>
$(document).ready(function() {
$('#example').DataTable(
);
} );
</script>
Answers
Plzz i need your help