# Color table rows by text column

**URL:** <https://community.grafana.com/t/color-table-rows-by-text-column/32089>\
**Category:** Configuration\
**Created:** [June 15, 2020, 7:02am UTC](https://community.grafana.com/t/color-table-rows-by-text-column/32089 "2020-06-15T07:02:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mortensickel](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/mortensickel/32/51819_2.png) [@mortensickel](https://community.grafana.com/u/mortensickel)\
**Post date:** [June 15, 2020, 7:02am UTC](https://community.grafana.com/t/color-table-rows-by-text-column/32089/1 "2020-06-15T07:02:40Z")

</div>

Using grafana 6.01, I am pulling in a table with a number of processes and their status which can be OK, Warning or Critical. I want to color each row in the table based on the value, but I have not found any way of doing that. I have tried to map the status values to numbers, i.e. OK=\>0, Warning =\>1, Critical =\>2 and I can use that column to color the rows -as long as I display it, but as this column has no value for the end users, I do not want to show the numbers. I have also tried to fetch the numerical column, map the numerical values to text, but in no case I manage to color the rows based on the textual values. Am I overlooking something, or is this a bug or missing feature in 6.0? It seems to be the same problem as [Grafana 6.0. Cannot color table cell](https://community.grafana.com/t/grafana-6-0-cannot-color-table-cell/14978)

I know grafana 7 has been released, but I have no time to do that upgrade yet.

---

<div class="post-metadata">

**Author:** ![zhangxianglong](https://avatars.discourse-cdn.com/v4/letter/z/ed8c4c/32.png) [@zhangxianglong](https://community.grafana.com/u/zhangxianglong)\
**Post date:** [January 27, 2021, 7:42am UTC](https://community.grafana.com/t/color-table-rows-by-text-column/32089/2 "2021-01-27T07:42:50Z")

</div>

I have a similar requirement, but it doesn’t seem to be available in Grafana 7 either.  
And it is also good to color table cell by regex, not just full-word matching.

---

<div class="post-metadata">

**Author:** ![zhengfengrao](https://avatars.discourse-cdn.com/v4/letter/z/b9bd4f/32.png) [@zhengfengrao](https://community.grafana.com/u/zhengfengrao)\
**Post date:** [July 16, 2023, 5:41am UTC](https://community.grafana.com/t/color-table-rows-by-text-column/32089/3 "2023-07-16T05:41:47Z")

</div>

we need this feature too

---

<div class="post-metadata">

**Author:** ![grant2](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/grant2/32/42281_2.png) [@grant2](https://community.grafana.com/u/grant2)\
**Post date:** [July 16, 2023, 9:47am UTC](https://community.grafana.com/t/color-table-rows-by-text-column/32089/4 "2023-07-16T09:47:26Z")

</div>

You can vote it up or add further comments on the [Github discussion for this issue](https://github.com/grafana/grafana/discussions/38151).

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [July 16, 2023, 6:38pm UTC](https://community.grafana.com/t/color-table-rows-by-text-column/32089/5 "2023-07-16T18:38:49Z")

</div>

look into Dynamic Text for that

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/7/3/738dfa523377ed038406ab212efb9d7839635128.png)

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [July 16, 2023, 6:51pm UTC](https://community.grafana.com/t/color-table-rows-by-text-column/32089/6 "2023-07-16T18:51:52Z")

</div>

even better is sort out the coloring in the query then use it in your loop

```auto

<table class="table">
<thead class="thead-dark">
<tr>
  <th scope="col">Metric</th>
  <th scope="col">Status</th>
</tr>
</thead>
<tbody>
  {{#each data}}
  <tr bgcolor={{ color }}>
	<td>{{ metric }}</td>
	<td>{{status }}</td>
  </tr>
  {{/each}}
</tbody>
</table>

```
