Splunk Search

How to change the background color table fieldname

skodak
Explorer

Can some one please help me to change the background color of Table fieldname.

By default I am getting the fieldname background color is GREY.

 

skodak_0-1596907708540.png

 

Labels (1)
0 Karma

renjith_nair
Legend

You can override the bootstrap default colors. Try this example and see if it fits your requirement

<dashboard>
  <label>Table Background</label>
  <row depends="$hidden_table$">
    <panel>
      <html>
        <style type="text/css">
          th {
            background-color: green !important;
            color:white !important;
          }
        </style>
      </html>
    </panel>
  </row>
  <row>
    <panel>
      <table>
        <search>
          <query>index=_internal|stats count by sourcetype</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
</dashboard>

 

table_th_bg.jpg

---
What goes around comes around. If it helps, hit it with Karma 🙂

skodak
Explorer

@renjith_nair 

 

I have used the same code whichyou have given as a test with appropriate index, but it's not updating the header color.

0 Karma

renjith_nair
Legend

@skodak ,

That works perfectly as seen in the screenshot. what if you run exactly same in a separate dashboard? It's a run anywhere example and should run for you as well

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

niketn
Legend

@skodak refer to one of my older answers on how to use Browser Inspector and CSS override to change Table Header Background and Font Color as per need.

https://community.splunk.com/t5/Splunk-Search/How-to-change-the-default-color-formatting-on-a-table-...

As stated in the link provided above, can you try the following?

 

<html depends="$alwaysHideCSSStyle$">
        <style>
            .table th {
               background-image: linear-gradient(to bottom, blue, turquoise) !important;
               text-shadow: none !important;
            }
            .table th a{
               color: white !important;
            }
        </style>
    </html>

 

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...