【问题标题】:Datatables warning in FirebugFirebug 中的数据表警告
【发布时间】:2011-08-09 18:50:12
【问题描述】:

所以我有一个由用户输入填充的数据表。当我进入屏幕时(在我提交任何内容之前),我不会在 firebug 中抛出任何警告。在我在表格中输入内容并提交之后。我自动返回到同一页面,只有表格中有我提交的信息。此时是我收到错误的时候。这里是:

DataTables warning (table id = 'table'): Unexpected number of TD elements. Expected 5
and got 6. DataTables does not support rowspan / colspan in the table body, and there 
must be one cell for each row/column combination.

似乎很明显,但我的桌子上没有 rowspan 或 colspan。所以我不知道问题是什么。另外,这是我对数据表的设置:

 var table1 = {};
 table1 = O_LANGUAGE = {sEmptyTable: "There is nothing here."};

        $(document).ready(function() {
      var $table= $("#table");
    $table.dataTable({
      "aaSorting": [ [0,'desc'] ], "oLanguage" : bsFaReq.O_LANGUAGE, "bLengthChange": false, "bFilter": false, "bAutoWidth": false, "bInfo": false, "bPaginate": false
      });

好的,所以它运行良好,但在修复此警告之前我无法将其发布,感谢任何帮助,提前谢谢你。

【问题讨论】:

    标签: jquery error-handling firebug datatables


    【解决方案1】:

    这是因为您的表中有 5 列,但发送的数据为 6。

    【讨论】:

      【解决方案2】:

      我认为您必须调试第一个警告,即“预期 5 并得到 6”,这意味着您正在尝试添加 6 个 td,而上面的行只有 5 个。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-01-29
        • 2015-08-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多