jquery排序表
我有这张桌子jquery排序表,jquery,Jquery,我有这张桌子 <table> <th> Food Name </th> <th> Restaurant Name </th> <?php if ($isCustomer == "1") { ?> <th> </th><?php } ?> <
<table>
<th>
Food Name
</th>
<th>
Restaurant Name
</th>
<?php
if ($isCustomer == "1") {
?>
<th>
</th><?php
}
?>
<?php while ($row = $allFoods->fetch()) { ?>
<tr>
<td>
<?php echo $row['foodName']; ?>
</td>
<td>
<?php echo $row['restaurantName']; ?>
</td>
<?php
if ($isCustomer == "1") {
?>
<td class="favoriteRow">
<a class="link" href="<?php echo URL . 'customer/addFavoriteFood/' . $row['foodID'] ?>"> Add Favorite</a>
</td>
<?php
}
?>
</tr>
<?php } ?>
</table>
食品名称
餐厅名称
我试着对它进行了很多排序,但我做不到,似乎我必须用已经排序的项目重新加载页面,但我需要使用jquery对其进行排序,任何帮助都将不胜感激您也可以在上使用我的可排序插件。它非常容易使用,并且非常可扩展。您也可以在上使用我的可排序插件。它非常容易使用,并且非常可扩展。我成功地使用了它,它是对html表进行排序的非常简单的方法 代码示例如下所示 html: 我成功地使用了,这是一种对html表进行排序的非常简单的方法 代码示例如下所示 html:
(这是个笑话)试试Stacksort:-)用法:你也可以使用why you need
jquery
在客户端排序,而你可以在服务器端在php
中排序,有时用户可能想根据其他字段或显示的信息对数据排序,与向服务器发送请求并等待响应相比,在页面上对其进行排序更容易、更快。资源密集度较低。(这是一个笑话)尝试Stacksort:-)使用:您还可以使用why do you needjquery
在客户端排序,而您可以在服务器端在php
中排序,有时用户可能希望根据其他字段或显示的信息对数据进行排序,与向服务器发送请求并等待响应相比,在页面上对其进行排序更容易、更快。资源密集度较低。
<table id="myTable" class="tablesorter">
<thead>
<tr>
<th>Last Name</th>
<th>First Name</th>
<th>Email</th>
<th>Due</th>
<th>Web Site</th>
</tr>
</thead>
<tbody>
<tr>
<td>Smith</td>
<td>John</td>
<td>jsmith@gmail.com</td>
<td>$50.00</td>
<td>http://www.jsmith.com</td>
</tr>
<tr>
<td>Bach</td>
<td>Frank</td>
<td>fbach@yahoo.com</td>
<td>$50.00</td>
<td>http://www.frank.com</td>
</tr>
<tr>
<td>Doe</td>
<td>Jason</td>
<td>jdoe@hotmail.com</td>
<td>$100.00</td>
<td>http://www.jdoe.com</td>
</tr>
<tr>
<td>Conway</td>
<td>Tim</td>
<td>tconway@earthlink.net</td>
<td>$50.00</td>
<td>http://www.timconway.com</td>
</tr>
</tbody>
</table>
$(document).ready(function()
{
$("#myTable").tablesorter();
}
);