使用 PHP 的数据表 [英] DataTable using PHP

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

问题描述

是否可以使用 PHP 编写数据表?

Is it possible to code a DataTable using PHP?

当在线搜索所有教程等都使用 ajax 时,我不太适应,所以只是想知道是否有一种方法可以只使用 PHP 来编写数据表 &如果是这样,有人有链接让我浏览吗?

When searching online all tutorials etc are using ajax, which I'm not to comfortable with so just wondering if there is a way of just using PHP to code a datatable & if so does anyone have a link for me to look through?

谢谢

推荐答案

尽管我完全同意您问题下方的评论!作为一种快速解决方法(没有学习曲线!)如果您的表格包含少于 10.000 行,您可以像您一样在 for/while 循环中简单地生成一个简单的 HTML 表格对于一个简单的表.然后像这样将表的 ID 传递给数据表:

Even though I totally agree with comments below your question! as a quick workaround (with no learning curve!) if your tables contain less than 10.000 rows you may simply generate a simple HTML table in a for / while loop as you would for a simple table. Then pass your table's ID to datatable like this:

$(document).ready(function() {
 $('#example').DataTable();
});

但毕竟,AJAX 的创建是为了让世界对我们更美好.:-)

But after all, AJAX is created to make world a better place for us. :-)

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

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