I would like to change some of the formatting of a Statistics Table in a dashboard, specifically the following:
I have found a number of articles that talk about changing rows or cells based on values in the table but that's not what I want. I just need to manipulate the CSS (I guess) so that I can apply our 'house style' to the tables.
I would like to apply different colour schemes to different tables in the same dashboard.
I am running Splunk Enterprise 8.0.2.
Is this possible?
For changing table header color try the following answer of mine. This answer also shows use of Browser Inspector for CSS Style Override. You can check out existing DOM path and corresponding bootstrap css that you need to override.: https://answers.splunk.com/answers/593399/column-headers-color.html
Do install Splunk Dashboard Examples app from Splunkbase and check out Custom Layout Dark
example with dark.css
which lists a lot of CSS Style Selectors for various Splunk Elements including table.
For Splunk Style Guide including table
, change your Splunk URL to the following location and check out which classes can be used for Bootstrap to work:
http://<yourSplunkServer>:8000/en-US/static/docs/style/style-guide.html#tables
For your specific query, add the following to your existing dashboard with table to test Table Header Color and Alternate row color CSS (PS: Table Cell color formatting will stop working because of this static CSS Style override):
<html depends="$alwaysHideCSSStyle$">
<style>
.table th {
background-image: linear-gradient(to bottom, #006297, #006297) !important;
text-shadow: none !important;
}
.table th a{
color: white !important;
}
table tr.odd td{
background: #7ED2FF !important;
}
table tr.even td{
background: #007ABD !important;
}
table tr td{
color: #fff !important;
}
</style>
</html>
Idea is to quickly test in Dashboard and once finalized move to actual CSS file.
Please try out and confirm!