Adding Title Attribute to th

Adding Title Attribute to th

lorengphdlorengphd Posts: 3Questions: 0Answers: 0
edited August 2012 in General
I am trying to add an attribute to the th (for tooltips). I know that I could put something inside the th with the title attribute, but the most desirable option would be something like Title Header

I assume I would add the option in aoColumns

aoColumns: [

{ "sTitle": "Title Header", "fnRender": function (obj) {
var sReturn = obj.aData[obj.iDataColumn];
return sReturn
}
},
]

I just don't know where to input something for a custom attribute like "title". (Not to be confused with sTitle).

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Probably not anywhere in the DataTables initialisation, but rather just after it:

    [code]
    $('#example thead th:eq(0)').attr('title', 'Hello');
    [code]

    for example.

    DataTables doesn't present a method to manipulate the `title` attribute of the header.

    Allan
This discussion has been closed.