Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- var index = $('th:contains("Mar")').eq(0).index();
- $("tr").each(function(rowIndex, row){
- $(row).find("th:eq(" + index + ")").css('background', 'green');
- $(row).find("td:eq(" + index + ")").html('<a href="index">+index+'</a>');
- });
- });
- 'columns':[{
- 'data': //your url data from json,
- render: function(data, type, row) {
- return '<a href= "'+ data +'"></a>"
- }
- }]
- var table = $('#example').DataTable({
- columnDefs: [{
- targets: 5,
- render: function (data, type, full, meta) {
- console.log(data);
- if (data.indexOf('1234567') >-1) {
- return '<a href="http://somelink' + data + '.jpg">' + data + '</a>';
- } else {
- return data;
- }
- }
- }]
- });
Add Comment
Please, Sign In to add comment