Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何仅在jQuery数据表的分页中显示数字_Jquery_Datatables - Fatal编程技术网

如何仅在jQuery数据表的分页中显示数字

如何仅在jQuery数据表的分页中显示数字,jquery,datatables,Jquery,Datatables,我对jQueryDataTables非常陌生。我正在寻找一种分页方式,在这种方式中,我只显示数字,而不显示诸如上一个、下一个等选项。我尝试了这种方式,但没有成功 $("#myCsps").dataTable({ "bFilter": false, "bInfo": true, "bProcessing": true, "sPaginationType": "bootstrap", "asStripClasses": null, "oLanguage": { "sI

我对jQueryDataTables非常陌生。我正在寻找一种分页方式,在这种方式中,我只显示数字,而不显示诸如上一个下一个等选项。我尝试了这种方式,但没有成功

$("#myCsps").dataTable({
  "bFilter": false,
  "bInfo": true,
  "bProcessing": true,
  "sPaginationType": "bootstrap",
  "asStripClasses": null,
  "oLanguage": {
    "sInfo": "Total CSPs: _TOTAL_",
    "oPaginate": {
      "sNext": "",
      "sLast": "",
      "sFirst": null,
      "sPrevious": null
    }
  },
  //oSearch: { "sSearch": "Type here...", "bRegex": false, "bSmart": false },
  "bLengthChange": false,
  "aaData": data,
  "aoColumns": columnSettings,
  "fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {

    $(nRow).children().each(function(index, td) {

      if (index == 7) {

        if ($(td).html() === "Schedule0") {
          $(td).css("background-color", "#078DC6");
        } else if ($(td).html() === "Schedule1") {
          $(td).css("background-color", "#FFDE00");
        } else if ($(td).html() === "Schedule2") {
          $(td).css("background-color", "#06B33A");
        } else if ($(td).html() === "Schedule3") {
          $(td).css("background-color", "#FF3229");
        } else {
          $(td).css("background-color", "#FF3229");
        }


      }
    });
    return nRow;
  }
});

你可以使用分页插件。你可能还需要做一点定制,但这很简单


这里是一个指向椭圆插件自定义版本的链接。

您可以使用分页插件。您可能还需要进行一点自定义,但这非常简单


这里是一个指向自定义版本的省略号插件的链接。

启动jQuery DataTables 1.10.8可以使用
pagingType:'numbers'
仅显示页码

var table = $('#example').DataTable({
    pagingType: 'numbers'
});

有关代码和演示,请参阅。

启动jQuery DataTables 1.10.8可以使用
pagingType:“数字”
仅显示页码

var table = $('#example').DataTable({
    pagingType: 'numbers'
});
有关代码和演示,请参阅