In a datatable, the tooltip has to be added to the only first column rows while the mouse hovers it,
Rendering | engine |Browser |Platform(s)Engine | version | CSS grade Gecko |Firefox 1.0 |Win 98+ | OSX.2+ | 1.7 | A Gecko |Firefox 1.5 |Win 98+ | OSX.2+ | 1.8 | A
$('#datatable').DataTable({
paging: false,
info: false,
dom: 'Bfrtip'
});
$('.data-tooltip').each(function() {
$(this).closest('td').addClass('tooltip');
})
<script> $(document).ready(function () {
$.each(datatable.data, function (i, item){
item.tooltip = item.name;
})
});
table = $('#example').DataTable({
columns: columns,
dom: "tp",
data: datatable.data,
createdRow: function ( row, data, index ) {
$("td:first", row).attr("title", data.tooltip);
}
});
var datatable={ "data": [
{ "name": "lion", "position": "System Architect" },
{ "name": "tiger", "position": "Accountant" }
]};
</script>