Jquery Datatable theme Hide header/footer balk

后端 未结 8 2370
梦毁少年i
梦毁少年i 2021-02-10 06:54

I am trying to remove the header/footer balk of this table

Picture of what I am trying to remove: \"enter

8条回答
  •  渐次进展
    2021-02-10 07:46

    I am not able to view the image, But I am assuming that you want only to display the table and remove the search,paging and info features..

    Add the following attribute in the dataTable declaration

    "sDom": 't'
    

    Some thing like this

    $(document).ready(function() {
        var oTable = $('#tableSmooth').dataTable({
        "bFilter": false, //Disable search function
         "bJQueryUI": true, //Enable smooth theme
            "sPaginationType": "full_numbers", //Enable smooth theme
            "sDom": 't'
        });
        });
    

    To get Back replace t with lfrtip

    "sDom": 'lfrtip'
    

    To display some of the features use it as

    "sDom": '<"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>'

    l= Length changing

    f= Filtering input

    r= pRocessing

    t= Table

    i= Info

    p= Pagination

    Have a look at dataTables sDom Options for more details

提交回复
热议问题