Javascript 排序、搜索(过滤器)、分页 HTML 表格
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6634317/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Sort, Search(Filter), Paginate HTML Table
提问by Gunjan Nigam
I want to sort, paginate and search(search based on a column) a HTML table. I was looking at the various JQuery Plugins like DataTable, TableSorter, Picnet Table Filter, etc. but I couldn't find any plugin which does all the 3 work (Searching, Sorting and Pagination). I have seen such a table in PHP Yii Framework but they have their own CSS and then I will have to convert my rewrite my whole project with Yii. DataTable does have a filter option but that will search a value along all the columns. What I want is to search only in one columns. I am not sure whether I will able to that with DataTable or not. Does anybody know is there any JQuery Plugin for this or any other method to do this
我想对 HTML 表进行排序、分页和搜索(基于列搜索)。我正在查看各种 JQuery 插件,如DataTable、 TableSorter 、Picnet Table Filter等,但我找不到任何可以完成所有 3 项工作(搜索、排序和分页)的插件。我在 PHP Yii 框架中看到过这样的表格,但它们有自己的 CSS,然后我将不得不使用 Yii 转换我的整个项目。DataTable 确实有一个过滤器选项,但它将沿着所有列搜索一个值。我想要的是只在一列中搜索。我不确定我是否能够使用 DataTable 做到这一点。有谁知道是否有任何 JQuery 插件用于此或任何其他方法来执行此操作
回答by Bj?rn
Found this in the demo's of DataTables: http://www.datatables.net/release-datatables/examples/api/multi_filter.html
在 DataTables 的演示中找到了这个:http: //www.datatables.net/release-datatables/examples/api/multi_filter.html
Should have all 3 of your requirements.
应该满足您的所有 3 个要求。
回答by Nikz
JP listwill be the perfect one for your requirement >> https://jplist.com/.
JP 列表将是您要求的完美列表>> https://jplist.com/。
Those who wants to work around with Divs elements, gallery, other html elements rather than tables , this will be the perfect jQuery plugin for this. This one includes Pagination, Sorting, Filtering and More. All in one package. Demos: https://jplist.com/demo
那些想要处理 Divs 元素、画廊、其他 html 元素而不是表格的人,这将是完美的 jQuery 插件。这包括分页、排序、过滤等。全部在一个包中。 演示:https: //jplist.com/demo