So I was able to replicate my table with tabular UI control. This is the actual setup:
msgAcct = {};
var coinbase = Number(msg.payload[0].usd_amount);
var binance = Number(msg.payload[1].usd_amount);
var binance_dc = ((msg.payload[1].day_profit_usd_percentage)*100).toFixed(2);
var ftxbots = Number(msg.payload[4].usd_amount);
var ftxbots_dc = ((msg.payload[4].day_profit_usd_percentage)*100).toFixed(2);
var ftxtrade = Number(msg.payload[6].usd_amount);
var ftxtrade_dc = ((msg.payload[6].day_profit_usd_percentage)*100).toFixed(2);
var ftxmain = Number(msg.payload[8].usd_amount);
var gate = Number(msg.payload[10].usd_amount);
var gate_dc = ((msg.payload[10].day_profit_usd_percentage)*100).toFixed(2);
var total = (coinbase+binance+ftxbots+ftxtrade+ftxmain+gate);
msgAcct.payload = [
{
"Binance": binance_dc+" %",
"FTX Bots": ftxbots_dc+" %",
"FTX Trade": ftxtrade_dc+" %",
"Gate": gate_dc+" %",
"TOTAL": " "
},
{
"Binance": "$ "+binance.toFixed(0),
"FTX Bots":"$ "+ftxbots.toFixed(0),
"FTX Trade":"$ "+ftxtrade.toFixed(0),
"Gate": "$ "+gate.toFixed(0),
"TOTAL": "$ "+total.toFixed(0)
},
{
"Binance": (((binance - 4000)/4000)*100).toFixed(2)+" %",
"FTX Bots": (((ftxbots - 40)/40)*100).toFixed(2)+" %",
"FTX Trade": (((ftxtrade - 500)/500)*100).toFixed(2)+" %",
"Gate": (((gate - 510)/510)*100).toFixed(2)+" %",
"TOTAL": (((total - 6000)/6000)*100).toFixed(2)+" %"
}
]
return msgAcct
{
"tabulator": {
"columns": [
{
"title": "Binance",
"field": "Binance",
"align": "center"
},
{
"title": "FTX Bots",
"field": "FTX Bots",
"align": "center"
},
{
"title": "FTX Trade",
"field": "FTX Trade",
"align": "center"
},
{
"title": "Gate",
"field": "Gate",
"align": "center"
},
{
"title": "TOTAL",
"field": "TOTAL",
"align": "center"
}
],
"item": "",
"layout": "fitColumns",
"movableColumns": false,
"groupBy": "",
"initialSort": "time"
}
}
However , I still don't understand how to select/style a row. For instance, I want to apply the following to the 1st and 3rd rows:
"formatter": "function(cell, formatterParams){var value = cell.getValue(); if (value !== null) {if(value >= 0){cell.getElement().style.color ='#609f70'} else {cell.getElement().style.color ='#ff4a68'} return value +'%';}}"