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!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...