Replace Character with
Replace Character with
Im using datatables in my table from which I print some db records.
I want to replace all , (comma) with a html tag <br />
This code is also working (https://jsfiddle.net/etjtm8d9/2/) but not on my datatables site. Do I need to do this with a other function?
'''
$(document).ready(function () {
var table = $('#example').DataTable({
columnDefs: [{
targets: "_all",
render: function (data, type, full, meta) {
if (type === 'display') {
return data.replace(/[,]+/, "<br />");
} else {
return data;
}
}
}]
});
});
'''