Dashboards & Visualizations

css file in xml file

jip31
Motivator

hi

i have done a css file but i dont know to to put it in the xml file
which tags are mandatory?

i'm looking for a xml example file with css Inside
thanks

Tags (1)
0 Karma
1 Solution

harishalipaka
Motivator

hi @jip
Here below app have many examples .. https://splunkbase.splunk.com/app/1603/

Thanks
Harish

View solution in original post

0 Karma

harishalipaka
Motivator

hi @jip
Here below app have many examples .. https://splunkbase.splunk.com/app/1603/

Thanks
Harish
0 Karma

manish_singh_77
Builder

Hi jip31,

You can refer the below sample and let me know if you have got any more queries..

<dashboard>
   <label>Test</label>
      <row>
     <panel>
    <html>
      <style>
      #sla_table {
     font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
     border-collapse: collapse;
     width: 100%;
 }

 #sla_table td, #sla_table th {
     border: 1px solid #ddd;
     padding: 2px;
 }

 #sla_table th {
     padding-top: 2px;
     padding-bottom: 2px;
     text-align: left;
     background-color: #C0C0C0;
     color: black;
 }

 </style>
     <table id = "sla_table">
   <tr>
     <th>Duration</th>
     <th>Start Time</th> 
     <th>Result Rows</th>
      </tr>
   <tr>
     <td>$duration$</td>
     <td>$starttime$</td>
     <td>$resultcount$</td>
       </tr>
   </table>
   </html>
   </panel>
   </row>
 </dashboard>
0 Karma

renjith_nair
Legend

Hi @jip31 ,

You can use <dashboard stylesheet="<style_filename>.css" script="<script_filename>.js"> in your XML

Reference : https://docs.splunk.com/Documentation/Splunk/7.1.1/AdvancedDev/UseCSS

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

jip31
Motivator

many thanks!

0 Karma

niketn
Legend

@jip31 kindly unaccept your comment and accept the answer below which has resolved your issue.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

Anam
Community Manager
Community Manager

@jip31

My name is Anam and I am the Community Content Specialist for Splunk Answers. As @niketnilay mentioned earlier to you, refrain from accepting your own answers and please accept the answer that has worked for you in this question. You also accepted another one of your own answers in this question as well: https://answers.splunk.com/answers/669860/plus-and-minus-in-a-trend-calcul.html which was fixed. We have awesome contributors in this community and their effort should be appreciated and encouraged!

0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...