user3101337
user3101337

Reputation: 364

How to apply css background color to text only, in datatables cell

I'd like to apply background color css to text in a datatable cell. Currenytly I can only apply the color to the whole cell, how can I apply it only to the text in the cell? Here is what I am using now:

$.each(aData, function(ii,value2){
          if (value.sTitle == "Priority" && aData[i] != ""){
              $('td:eq(' + i + ')', nRow).css('background-color', '#F6CED8');
            }   
        }); 

Upvotes: 1

Views: 1306

Answers (1)

Exga
Exga

Reputation: 26

Like the other user said. Put it inside div or p tags and change the background color of that specific object.

Upvotes: 1

Related Questions