Column names aren't being displayed

Column names aren't being displayed

guilhermemaranhaoguilhermemaranhao Posts: 38Questions: 11Answers: 0

Guys,

My table is declared as follow:

<div id="divTable" style="height: 600px; width: 53%; float: left">
  <table id="myTable" class="row-border hover order-column" style="width: 100%">
  </table>
</div>
```![](https://datatables.net/forums/uploads/editor/jb/myq1m8w8z1rw.png "")


The DataTable is being instantiated as follow:

```js
$('#myTable').DataTable({
                destroy: true,
                initComplete: function(settings, json) {
                    // do some stuff...
                },
                ajax: {
                    url: "/my_service"
                    dataSrc: function(data){
                        // do some stuff...
                       // data item is
                      // for example: data[0] = {
                                  field1: "aaaa",
                                  field2: "bbbb", 
                                  field3: "cccc",
                                  field4: "dddd"
                          }
                        return data;
                    }
                },
                columns: [
                    { data: 'field1' },
                    { data: 'field2' },
                    { data: 'field3' },
                    { data: 'field4' }
                ],
                order: [[ 1, 'asc' ]],
                scrollY:        400,
                deferRender: true,
                scroller: true,
                columnDefs: [
                    { targets: 1, type: 'diacritics-neutralise' }
                ],
                language: {
                    url: '/pt-BR.json'
                }
            });

But the column names aren't being displayed (please, find the image attached).

I've done according to the manual (https://datatables.net/manual/data/).

Thank you,

Guilherme

Answers

This discussion has been closed.