HTML表格排序 [英] HTML table sort

查看:119
本文介绍了HTML表格排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以基本上我正在运行一个mysql查询,它从我的数据库中提取数据,并以易于阅读的布局显示给我的用户。
姓名-----地址----销售人员



您获得要点。现在我想让用户对销售人员进行排序。我将如何轻松地使用下拉菜单来做到这一点?这是我迄今为止....我只是不知道如何告诉菜单排序HTML表。

 < div class ='menu'> 
< ul>
< li>< a href ='#'>< span>销售人员< / span>< / a>
< ul>
< li>< a href ='#'>< span>梅丽莎< / span>< / a>< / li>
< li>< a href ='#'>< span> Justin< / span>< / a>< / li>
< li>< a href ='#'>< span> Judy< / span>< / a>< / li>
< li>< a href ='#'>< span> Skipper< / span>< / a>< / li>
< li>< a href ='#'>< span> Alex< / span>< / a>< / li>
< / ul>
< / li>
< / div>

非常感谢您的任何帮助。

解决方案

检查是否可以使用下面提到的任何JQuery插件。非常棒,并提供广泛的选项来完成工作,并减少整合的痛苦。 :)



http://tablesorter.com/docs/ - 表分拣机。

https://github.com/paulopmx/Flexigrid - Flexgrid />
http://datatables.net/index - 数据表。

https://github.com/tonytomov/jqGrid



如果没有,您需要链接到那些调用服务器端脚本来调用排序的表头。


So basically I am running a mysql query that fetches data from my database and displays it in an easy to read layout for my users. Name-----Address----Sales Person

You get the gist. And now I want to let the user sort the html table by let's say sales person. How would I easily do that using a drop down menu? This is what I have so far....I just don't really know how to tell the menu to sort the html table.

<div class='menu'>
<ul>
    <li><a href='#'><span>Sales Person</span></a>
  <ul>
     <li><a href='#'><span>Melissa</span></a></li>
     <li><a href='#'><span>Justin</span></a></li>
     <li><a href='#'><span>Judy</span></a></li>
     <li><a href='#'><span>Skipper</span></a></li>
     <li><a href='#'><span>Alex</span></a></li>
  </ul>
   </li>
</div>

Any help is greatly appreciated.

解决方案

Check if you could go with any of the below mentioned JQuery plugins. Simply awesome and provide wide range of options to work through, and less pains to integrate. :)

http://tablesorter.com/docs/ - Table Sorter.
https://github.com/paulopmx/Flexigrid - Flexgrid
http://datatables.net/index - Data tables.
https://github.com/tonytomov/jqGrid

If not, you need to have a link to those table headers that calls a server-side script to invoke the sort.

这篇关于HTML表格排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆