DataTable using PHP(使用 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 的数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 PHP 的数据表
基础教程推荐
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何替换eregi() 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
