21

I am using the DataTables plugin (www.datatables.net) for jQuery to display tables on a web page.

After reading through the documentation and doing some searches, I am unable to find out how to completely suppress or hide table headers, using the DataTables options or API.

Cœur
  • 37,241
  • 25
  • 195
  • 267
mydoghasworms
  • 18,233
  • 11
  • 61
  • 95

4 Answers4

36

Why don't you simply hide them through css (i think datatables requires a thead section to work)?

.dataTables_wrapper table thead{
    display:none;
}

fiddle here: http://jsfiddle.net/LhZF3/

Nicola Peluchetti
  • 76,206
  • 31
  • 145
  • 192
15

I know the question is pretty old, but I searched for it today and found another solution ...

In your js / coffee file:

$("#selector").dataTable({
  ... your other options ...

  fnDrawCallback: -> $("#selector thead").remove()
})

Pure JS variant:

$("#selector").dataTable({
  ... your other options ...

  fnDrawCallback: function() {
    $("#selector thead").remove();
  }
});
s.krueger
  • 1,043
  • 8
  • 13
7

Simple add the style display:none inline style to your thead tag.

    <thead style="display:none;">
    </thead>
Lucky
  • 16,787
  • 19
  • 117
  • 151
1

Just add this to your css:

thead {
  display:none;
}
Esa Mäkinen
  • 160
  • 8