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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...