1

how can I remove a tool bar at the top of a datatable? I have tried the dirty way:

$(document).load(function() {
  $('.btn-group .float-right .tabletools-topbar').hide();
});

Thanks!

daru79
  • 31
  • 1
  • 9
  • Possible duplicate of [How to suppress table headers completely in jQuery DataTables?](https://stackoverflow.com/questions/6732254/how-to-suppress-table-headers-completely-in-jquery-datatables) – 4b0 Apr 11 '18 at 10:27

1 Answers1

2

You need to set the sDom parameter according to your needs when initializing your datatable.

If you only want a simple table, just do :

$('#yourTable').dataTable({
    "sDom": 't'
});

Here is a list of allowed options :

  • l - Length changing
  • f - Filtering input
  • t - The table!
  • i - Information
  • p - Pagination
  • r - pRocessing
Zenoo
  • 12,670
  • 4
  • 45
  • 69
  • and there is a 'T' option for toolbar :) - that it was! :) – daru79 Apr 11 '18 at 10:39
  • I thinks many things changed since this answer. even by including everything `"sDom": 'Tlftipr'` table looks weird and out of shape. even styles are not applied. – AaA Sep 10 '21 at 01:56
  • reading through code comments I noticed that this is mostly used for ordering the elements in the container with lfrtip being default. however setting it to `lfrtip` still didn't render the table correctly. – AaA Sep 10 '21 at 02:07