无法像他们的网站上那样获得确切的 DataTables 主题!
我开始使用 DataTables,它是一个 jquery 插件。我仔细遵循了所有说明,该表运行良好,但存在主题问题。我正在尝试获得与他们网站演示中完全相同的样式。
以下是我包括的样式:
<link type="text/css" rel="stylesheet" href="/public/js/DataTables/media/css/demo_table.css">
<link type="text/css" rel="stylesheet" href="/public/js/jqueryui/css/smoothness/jquery-ui-1.8.13.custom.css">
这是脚本:
<script src="/public/javascripts/jquery-1.5.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/public/js/DataTables/media/js/jquery.dataTables.js" type="text/javascript" charset="utf-8">
</script>
<script src="/public/js/jqueryui/js/jquery-ui-1.8.13.custom.min.js" type="text/javascript" charset="utf-8">
我使用 jquery 如下:
$(function(){
var oTable = $('#myTable').dataTable({
"bJQueryUI": true,
});
这是我得到的: ![在此处输入图像描述][1]
我试图获得与该页面中的表格相同的外观:
I started using DataTables which is a jquery plugin. I followed all the instructions carefully, and the table is working nice, but with theme problems. I am trying to get the exact style as on their website demo.
Here are the styles am including:
<link type="text/css" rel="stylesheet" href="/public/js/DataTables/media/css/demo_table.css">
<link type="text/css" rel="stylesheet" href="/public/js/jqueryui/css/smoothness/jquery-ui-1.8.13.custom.css">
And here are the scripts:
<script src="/public/javascripts/jquery-1.5.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/public/js/DataTables/media/js/jquery.dataTables.js" type="text/javascript" charset="utf-8">
</script>
<script src="/public/js/jqueryui/js/jquery-ui-1.8.13.custom.min.js" type="text/javascript" charset="utf-8">
And I use jquery like:
$(function(){
var oTable = $('#myTable').dataTable({
"bJQueryUI": true,
});
And here is what I get:
![enter image description here][1]
I am trying to get the same look as the table in that page:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还应该添加选项“sPaginationType”:“full_numbers”。
尝试这样:
如果问题是颜色,则这些颜色取决于您下载的 Jquery UI 主题。我认为在 datatables.net 上他们使用主题“平滑度”...无论如何,看看 这里
You should also add the option "sPaginationType": "full_numbers".
Try like this:
If the problem are the colors, those depend from the Jquery UI theme you have downloaded. I think on datatables.net they use the theme 'Smoothness'...anyway, look here