How can I remove the search bar and footer added by the jQuery DataTables plugin?

前端 未结 19 2653
孤街浪徒
孤街浪徒 2020-12-07 07:45

I am using jQuery DataTables.

I want to remove the search bar and footer (showing how many rows there are visible) that is added to the table by default. I just wan

19条回答
  •  悲哀的现实
    2020-12-07 08:00

    As said by @Scott Stafford sDOM is the most apropiated property to show, hide or relocate the elements that compose the DataTables. I think the sDOM is now outdated, with the actual patch this property is now dom.

    This property allows to set some class or id to an element too, so you can stylish easier.

    Check the oficial documentation here: https://datatables.net/reference/option/dom

    This example would show only the table:

    $('#myTable').DataTable({
        "dom": 't'
    });
    

提交回复
热议问题