I have a task, I need to make it possible to sort the table by last name or first name. Install the plugin from here http://tablesorter.com/docs/ Connected as indicated in the documentation. But does not work. My table is generated automatically. What could be the problem? Where to look?
<table id="myTable" class="tablesorter" align="center" border="1"> <thead> <tr> <td>Фамилия</td> <th>Имя</th> <th>Возраст</th> <th>Телефон</th> <th>Умеет водить</th> <th>Статус</th> <th>Редактировать</th> </tr> </thead> Next comes a piece of code for pagination, and then the table output.
while($row = mysql_fetch_assoc($result)):?> <tbody> <tr> <td> <?echo $row['sname'];?> </td> <td> <?echo $row['name'];?> </td> <td> <?echo calculate_age($row['dateb']);;?> </td> <td> <?echo $row['mob'];?> </td> <td> <?echo $row['buses'];?> </td> <td> <input id='input<?=$row['id']?>' name='active' type='checkbox' value ='<?=$row["active"]?>' onchange="on_change(<?=$row['id']?>)" <?php if($row['active'] == '1') {echo 'checked="checked"';} else { echo "";} ?> /> </td> <td> <a href = "index.php"> Изменить </a> </td> </tr> </tbody> <? endwhile;?> </table>