defaultContent formatting
defaultContent formatting
Is there a way to format this to make it Bold and currency where Total is a passed var?
{ data: null, defaultContent: + Total, orderable: false},
I can format it with php but I want to do it above in .js->
{ data: null, defaultContent: '<b><?php echo '$'.number_format($Total,2); ?><b>', orderable: false },
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Easiest option might be to use a class name to the column (
columns.className
) and use a little CSS to make it bold (font-weight
). Then you can use the built in number formatter that is used is many of the Editor examples. Otherwise you will need to usecolumns.render
as a function to format the number and add the HTML formatted needed.Allan
className worked fine. For the formatting I kept receiving Nan so I used another script to format the variable-Currency. Currency is not in my database.