I want to use Datatables with div structure instead of tables. the purpose is to meet design requirements. is there any possible way or any alternative for that?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
No you will not be able to do this... The core of Datatables will only work on table elements and child thead tbody tfooter tr td th elements... You will need to write your own pagination code to handle your div cards or download another plugin... jquery Datatables will not support that.
here is a good one? This even looks like jquery datatables pagination. https://esimakin.github.io/twbs-pagination/#demo
回答2:
Sure you can!
I think what you're looking for is manipulating the dom object of Datatables!
A simple example of adding some divs to the table ->
$('#example').dataTable({
dom: '<"top"i>rt<"bottom"flp><"clear">'
});
This will give you wrapper divs around table content, filters and the whole table.
You can learn more by reading the official documentation from their website.
Here's a link to the documentation ->https://datatables.net/reference/option/dom