Yes. It would sit right there and you would have to do a little data manipulation to get what you want.
<div id="screener2"></div>
<script>
var screener2Table = new Tabulator("#screener2", {
rowFormatter:function(row){
//row - row component
var rowM = row.getCell("Number");
var rowMarker = rowM.getValue();
var rowT = row.getCell("TOTAL");
var rowTrigger = rowT.getValue();
if(cellData == "24HR"){
if(rowTrigger > 0){
row.getElement().style.backgroundColor = "#00ff00";
}
if(rowTrigger < 0){
row.getElement().style.backgroundColor = "#ff0000";
}
}
},
height:800,
//textSize : 10,
layout:"fitColumns",
columns:[
{title:"",field:"Number",hozAlign:"center",frozen:true},
{title:"Binance",field:"Binance",hozAlign:"center"},
{title:"FTX",field:"FTX",hozAlign:"center"},
{title:"Gate",field:"Gate",hozAlign:"center"},
{title:"Paper",field:"Paper",hozAlign:"center"},
{title:"TOTAL",field:"TOTAL",hozAlign:"center"}
]
});
/*screener2Table.on("rowClick", function(e, row){
//Uncomment this whole event to use it
});*/
(function(scope){
scope.$watch('msg', function(msg){
if(msg){
screener2Table.setData(msg.payload, true);
}
});
})(scope);
</script>
You'll notice I did a few things in your rowFormatter function. First, I used the row component and extracted the cell component I was looking for into a variable. I then extracted the value of the cell component and placed it into another variable I could check against. I did this both to find the row I wanted to look at as well as the value I wanted to check against for the formatting, hence the two different cells and values. Once I had the values, I checked to see if the current row had a cell value in the Number column of "24HR". If it did, I checked to see whether TOTAL was less than or greater than 0 and applied the background colors accordingly. I picked the TOTAL column since I figured that held the number you were comparing against. If it is a different column, just change TOTAL to whatever it is.
Let me know if there is still any confusion.