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!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

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

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...