Dashboards & Visualizations

How to change font colour for a particular table cell?

aru949
Explorer

Im able to change the font of a particular row but I want to change the font colour of a particular cell depending on a condition.

I found a way described in https://blog.avotrix.com/change-font-color-of-table-cell-value-in-splunk/ but this involves using JS. Is there any way to do this without using javascript?

Labels (6)
0 Karma

TrangCIC81
Communicator

If you want to change the font color for a specific table cell without any specific condition, you can use CSS to target that cell and set its color.

For ex:

 

<table>
  <row>
    <th>Header 1</th>
    <th>Header 2</th>
    <th>Header 3</th>
  </row>
  <row>
    <td style="color: red;">Cell 1</td>
    <td>Cell 2</td>
    <td>Cell 3</td>
  </row>
  <row>
    <td>Cell 4</td>
    <td>Cell 5</td>
    <td>Cell 6</td>
  </row>
</table>

 


In this example, the style attribute is used to set the font color of the first cell in the second row to red. You can modify this code to target the specific cell that you want to change the font color for in your table.

What is your current code like? I can have a look on it and adjust.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...