問題描述
是否可以使用 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 的數據表的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!