# Examples for node-red-node-ui-table

**URL:** https://discourse.nodered.org/t/examples-for-node-red-node-ui-table/14256
**Category:** Dashboard
**Created:** [12 August 2019 17:52 UTC](https://discourse.nodered.org/t/examples-for-node-red-node-ui-table/14256 "2019-08-12T17:52:43Z")
**Posts on this page:** 1
**Showing post:** 86

<div class="post-metadata">

### Author: ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)
#### Post date: [17 June 2020 23:18 UTC](https://discourse.nodered.org/t/examples-for-node-red-node-ui-table/14256/86 "2020-06-17T23:18:58Z")

</div>

Yes ... I use this function in my "remote device table"

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/1/41322b8d346aaa17e23e2d2b7152a51fca2f3fab.png)

to indicate the state of my remote devices.

```auto
{
    "tabulator": {
        "rowFormatter": "function(row){ var data = row.getData(); switch (data.$state) { case \"lost\": row.getElement().style.backgroundColor = \"#9e2e66\"; row.getElement().style.color = \"#a6a6a6\"; break; case \"sleeping\": row.getElement().style.backgroundColor = \"#336699\"; break; case \"disconnected\": row.getElement().style.backgroundColor = \"#cc3300\"; row.getElement().style.color = \"#a6a6a6\"; break; case \"alert\": row.getElement().style.backgroundColor = \"#A6A6DF\"; break; case \"init\": row.getElement().style.backgroundColor = \"#f2f20d\"; break; case \"ready\": row.getElement().style.backgroundColor = \"\"; row.getElement().style.color = \"\"; break; } }",
    }
}

```

```auto
rowFormatter = function(row){
    var data = row.getData();
    switch (data.$state) {
        case "lost":
            row.getElement().style.backgroundColor = "#9e2e66";
            row.getElement().style.color = "#a6a6a6";
            break;
        case "sleeping":             
            row.getElement().style.backgroundColor = "#336699";             
            break;         
        case "disconnected":             
            row.getElement().style.backgroundColor = "#cc3300";             
            row.getElement().style.color = "#a6a6a6";             
            break;         
        case "alert":             
            row.getElement().style.backgroundColor = "#A6A6DF";             
            break;         
        case "init":             
            row.getElement().style.backgroundColor = "#f2f20d";             
            break;         
        case "ready":             
            row.getElement().style.backgroundColor = "";             
            row.getElement().style.color = "";             
            break;         
    }
}

```

It could be that your boolean values are not stored as boolean type. I would insert a `debugger` statement behind the row.getData() call and check what value and type `data.value` actually is. _(I love the "beauty" of javascript)_

---

_[View the full topic](https://discourse.nodered.org/t/examples-for-node-red-node-ui-table/14256)._
