<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need to apply header color based on the header value on the table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/410045#M118276</link>
    <description>&lt;P&gt;@premranjithj &lt;/P&gt;

&lt;P&gt;You can use CSS. You have to define CSS on the basis of the value of the header.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;th[data-sort-key='&amp;lt;&amp;lt;HEADER_VALUE&amp;gt;&amp;gt;'] {
    &amp;lt;&amp;lt;HEADER_VALUE_BASED_CSS&amp;gt;&amp;gt;
    }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Check below example.&lt;/P&gt;

&lt;P&gt;mydashboard.xml&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard stylesheet="test.css"&amp;gt;
  &amp;lt;label&amp;gt;Color Table Headers&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;Test&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal | stats count by host,sourcetype, source&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-60m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;test.css&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;th[data-sort-key='source'] {
background-color: aqua!important;
}


th[data-sort-key='host'] {
background-color: antiquewhite !important;
}

th[data-sort-key='sourcetype'] {
background-color: burlywood!important;
}

th[data-sort-key='count'] {
background-color: chartreuse!important;
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here, in my table, I have 4 columns (host,sourcetype, source, count). According to the value of headers, I have defined &lt;CODE&gt;background-color&lt;/CODE&gt;. You can change stylesheet as per your need.&lt;/P&gt;

&lt;P&gt;Just try and let me know.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 05 Mar 2019 06:23:05 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-03-05T06:23:05Z</dc:date>
    <item>
      <title>How to apply header color based on the header value on the table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/410042#M118273</link>
      <description>&lt;P&gt;I have 10 columns and want to color header alone with different color codes based on value of the header since column will be filtered and sorted will not remain in the same position we cant map color based on the position of the header&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 19:30:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/410042#M118273</guid>
      <dc:creator>DataOrg</dc:creator>
      <dc:date>2023-06-27T19:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need to apply header color based on the header value on the table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/410043#M118274</link>
      <description>&lt;P&gt;Attention @niketnilay!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 06:35:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/410043#M118274</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-01T06:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need to apply header color based on the header value on the table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/410044#M118275</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
Kindly check the link below on Splunk answers. It might help you.&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/198494/colouring-header-of-the-table-in-splunk.html"&gt;https://answers.splunk.com/answers/198494/colouring-header-of-the-table-in-splunk.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 07:23:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/410044#M118275</guid>
      <dc:creator>nikita_p</dc:creator>
      <dc:date>2019-03-01T07:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need to apply header color based on the header value on the table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/410045#M118276</link>
      <description>&lt;P&gt;@premranjithj &lt;/P&gt;

&lt;P&gt;You can use CSS. You have to define CSS on the basis of the value of the header.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;th[data-sort-key='&amp;lt;&amp;lt;HEADER_VALUE&amp;gt;&amp;gt;'] {
    &amp;lt;&amp;lt;HEADER_VALUE_BASED_CSS&amp;gt;&amp;gt;
    }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Check below example.&lt;/P&gt;

&lt;P&gt;mydashboard.xml&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard stylesheet="test.css"&amp;gt;
  &amp;lt;label&amp;gt;Color Table Headers&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;Test&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal | stats count by host,sourcetype, source&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-60m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;test.css&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;th[data-sort-key='source'] {
background-color: aqua!important;
}


th[data-sort-key='host'] {
background-color: antiquewhite !important;
}

th[data-sort-key='sourcetype'] {
background-color: burlywood!important;
}

th[data-sort-key='count'] {
background-color: chartreuse!important;
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here, in my table, I have 4 columns (host,sourcetype, source, count). According to the value of headers, I have defined &lt;CODE&gt;background-color&lt;/CODE&gt;. You can change stylesheet as per your need.&lt;/P&gt;

&lt;P&gt;Just try and let me know.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 06:23:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/410045#M118276</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-03-05T06:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need to apply header color based on the header value on the table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/410046#M118277</link>
      <description>&lt;P&gt;@premranjithj refer to one of my older answers: &lt;A href="https://answers.splunk.com/answers/612296/how-to-change-the-header-color-dynamically-using-j.html"&gt;https://answers.splunk.com/answers/612296/how-to-change-the-header-color-dynamically-using-j.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 06:29:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/410046#M118277</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-03-05T06:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need to apply header color based on the header value on the table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/410047#M118278</link>
      <description>&lt;P&gt;@premranjithj if your issue is resolved, do accept the answer to mark this question as answered!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 17:38:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/410047#M118278</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-03-07T17:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need to apply header color based on the header value on the table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/547005#M155076</link>
      <description>&lt;P&gt;I tried using this code (put the .CSS file in apps/appserver/static) but was unable to change color for the values in header for my table.. I have some static headers values and need to change the color for them.. Can anyone help please?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 09:57:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/547005#M155076</guid>
      <dc:creator>Subham</dc:creator>
      <dc:date>2021-04-07T09:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need to apply header color based on the header value on the table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/648400#M224350</link>
      <description>&lt;P&gt;This worked perfectly for me.&amp;nbsp; Very straightforward solution.&amp;nbsp; Thanks for posting it.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 15:48:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-header-color-based-on-the-header-value-on-the-table/m-p/648400#M224350</guid>
      <dc:creator>KevinMMiller</dc:creator>
      <dc:date>2023-06-27T15:48:17Z</dc:date>
    </item>
  </channel>
</rss>

