jQuery DataTables问题:列和行不在一行 [英] jQuery DataTables issue: columns and rows not in one line

查看:395
本文介绍了jQuery DataTables问题:列和行不在一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个x和y轴滚动和左侧的固定列。我的问题是thead到tbody的位置和行的位置。列和行不是精确地显示在一行中,它们有点移位。

I'm having a x- and y-axis scroll and fixed columns on the left side. My problem is the position of the thead to the tbody and the position of the rows. The columns and rows are not displayed exactly in one line, they are a little bit displaced.

我试过这个:

当使用CSS冻结表头时,表头和正文没有正确对齐

jQuery Datatables标头与垂直对齐滚动

固定列标题宽度与主体列宽度不匹配

但它对我无效。

这是我的javascript:

This is my javascript:

$(document).ready(function(){ 

var height = ($(window).innerHeight() - 180);

var oTable = $('#tableOverview').dataTable({
    "oLanguage": {
        "sProcessing":   "Bitte warten...",
        "sLengthMenu":   "_MENU_ Einträge anzeigen",
        "sZeroRecords":  "Keine Einträge vorhanden.",
        "sInfo":         "_START_ bis _END_ von _TOTAL_ Einträgen",
        "sInfoEmpty":    "0 bis 0 von 0 Einträgen",
        "sInfoFiltered": "(gefiltert von _MAX_  Einträgen)",
        "sInfoPostFix":  "",
        "sSearch":       "Suchen",
        "sUrl":          "",
        "oPaginate": {
            "sFirst":    "Erster",
            "sPrevious": "Zurück",
            "sNext":     "Nächster",
            "sLast":     "Letzter"
        }
      },
    "sScrollY": height,
    "sScrollX": "99%",
    "bPaginate": false   
    });
    new FixedColumns( oTable, {
      "iLeftColumns": 3
    } );       
});

查看完整示例:

a href =http://jsfiddle.net/n74XN/2/ =nofollow> http://jsfiddle.net/n74XN/2/

http://jsfiddle.net/n74XN/2/

(固定列有时工作,有时不在jsfiddle示例中,我认为这是因为结果窗口)。
表的数据由php动态加载(不在测试用例中)。在这里您可以看到实际应用程序的图片:

(fixed columns are working sometimes and sometimes not in the jsfiddle example, i think it's because of the result window). The data for the table is loaded dynamically by php (not in the test case). Here you can see a picture of the real application:

http://www.picamatic.com/view/9721451_DataTable/

我使用此插件通过引导进行可视化:

I use this plugin for visualisation with bootstrap:

https://github.com/数据表/插件/ tree / master / integration / bootstrap / 3

和FixedColumns插件。

and the FixedColumns Plugin.

我如何让他们显示正确?

How do i get them displayed right?

推荐答案

修改了更改的.js文件

Fixed changing .js file

oGrid.left.body.style.height = $(this.dom.scroller).height() **- 40** + "px";

http://datatables.net/forums/discussion/5839/scroll-with-fixedcolumn/p1?post#Form_Body

这篇关于jQuery DataTables问题:列和行不在一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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