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!

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 ...