Italic when data is null

Italic when data is null

karliekarlie Posts: 83Questions: 17Answers: 0
edited May 2018 in DataTables 1.10

I would like to italicise the output when cell data is null and the value comes from a formula

if ( row['ten_margin'] &&row['each_cost_price'] !== null )
        {return "£" + (row['each_cost_price'] * row['ten_margin']).toFixed(2);}

So the output from the above code I would like italicised.

Any pointers much appreciated.

Replies

  • allanallan Posts: 61,624Questions: 1Answers: 10,090 Site admin

    Wrap it in i tags: return "<i>£....

    Allan

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @karlie ,

    This example here shows how to italise text - in this example, if the number in the fourth column is less that 30, it's italicised. You could do something like this.

    Cheers,

    Colin

  • karliekarlie Posts: 83Questions: 17Answers: 0

    What example is that Colin?

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Sorry, it would help if I make the link - here it is: http://live.datatables.net/xireqobu/1/edit

  • karliekarlie Posts: 83Questions: 17Answers: 0

    Thanks Colin

This discussion has been closed.