I have a table on a page in which I use the datatables.jquery plugin, which for me is very practical and functional.
It turns out that in the table I use two hidden fields, the id and the nrologins (I use the latter to order the data that the sql query brings)
<table id="tabla" class="ui celled stackable table">
<thead>
<tr>
<th hidden>nrologins</th>
<th hidden>Id</th>
<th>Nombre</th>
<th>Apellido</th>
</tr>
</thead>
<tbody>
<?php
if ($arrDatos) {
foreach ($arrDatos as $row) { ?>
<tr>
<td hidden> <?php echo $row['nrologins']; ?> </td>
<td hidden> <?php echo $row['id']; ?> </td>
<td> <?php echo $row['nombre']; ?> </td>
<td> <?php echo $row['apellido']; ?> </td>
</tr>
<?php }} ?>
</tbody>
</table>
Now, at full screen, it works fine but when I reduce the screen (or for example I see it from the mobile) the "hidden" fields are shown !!!... How can I prevent this from happening?
Try to hide the fields in your JS code, add the following in your datatable configuration:
Targets specifies the position of the column you want to hide.