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!

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