Help with "ColumnDefs" not recognizing percentage numbers

Help with "ColumnDefs" not recognizing percentage numbers

chriis716chriis716 Posts: 0Questions: 1Answers: 0
edited September 2017 in Free community support

I'm having an issue where my tables are not being highlighted on numbers that are 100%, only the numbers that are between 01-99 are highlighted with their respectable class. Is there a way for me to get ColumnDefs to work with the number 100? Maybe a workaround to highlight a single digit that's the value of 100? Any help with this is greatly appreciated. Thanks!

Here's code I'm using:

columnDefs: [
                {visible: false, "targets": 0}, 
                {"targets": 6,
                "createdCell": function (td, cellData, rowData, row, col) {
                    <!-- Anything below 35% will be highlighted in red-->
                    if ( cellData < "35.99%") {
                    $(td).addClass('highlight1')
                    }
                    <!-- Anything between 35%-65% will be in Yellow-->
                    else if ( cellData < "65.99%") {
                    $(td).addClass('highlight2')
                    }
                    <!-- Anything Greater than 66% will be in Green-->
                    else if ( cellData > "66.00%") {
                    $(td).addClass('highlight3')
                    }
                    
                }
                }],

This discussion has been closed.