如何将多个 jquery 数据表放在一页中? [英] how to put multiple jquery dataTables in one page?

查看:14
本文介绍了如何将多个 jquery 数据表放在一页中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 jquery dataTables 来展示一些东西.

I want to use jquery dataTables to show something.

当我将一个数据表放在一页中时效果很好,然后我再添加一个,但它们占据几乎相同的位置,其中一个效果不佳.

It works well when i just put one dataTable in one page, then i add one more, but they occupied almost the same position, and one of them doesn't work well.

你知道如何处理吗?

推荐答案

<table id="table1" class="display"> </table>
<table id="table2" class="display"> </table>
<table id="table3" class="display"> </table>

$(document).ready(function() {
  $('table.display').DataTable();
} );

只要你给正确的类,所有三个表都会显示

All three tables will be displayed as long as you give the right class

<-- 你写的是 dataTable 而不是 DataTable-->

<-- You wrote dataTable instead of DataTable-->

这篇关于如何将多个 jquery 数据表放在一页中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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