-1

So the question would be, in a legacy jquery datatable ( not the "new" version of it ) how can i set a title on the cell(td) with its content?

Henrique C.
  • 948
  • 1
  • 14
  • 36
  • SO supports self-answered questions. Please edit your answer in the form of a question, one that does not presuppose an answer. Then answer your question in separate "answer" post. – JDB Sep 27 '19 at 16:34
  • Thank you. I have changed it. – Henrique C. Sep 28 '19 at 17:23

1 Answers1

-1

And here is the code:

In the properties of the datatable($("#MySpecialDatatable").datatable({properties})):

...
"fnDrawCallback": function(oSettings) {                 
                $("#MySpecialDatatable tbody tr").each(function () {
                    var nTds = $('td', this);
                    $(nTds).each(function () {
                        var td = this;
                        td.setAttribute('title', $(td).text());
                    });
                });
            },
    ...
Henrique C.
  • 948
  • 1
  • 14
  • 36