Dashboards & Visualizations

How to align numbers in the center of a dashboard?

rashi83
Path Finder

In a dashboard column,
I want numbers to be aligned in the center.
Currently, it's coming to the right side.

0 Karma
1 Solution

DavidHourani
Super Champion

Hi @rashi83,

You can do that with a little CSS magic, could you try the solution here and let me know if it works out for you ?
https://answers.splunk.com/answers/593401/how-to-allign-cell-values-of-table-in-splunk-dashb.html

Should be as simple as defining an ID for the table and then applying CSS to it.

Cheers,
David

View solution in original post

0 Karma

DavidHourani
Super Champion

Hi @rashi83,

You can do that with a little CSS magic, could you try the solution here and let me know if it works out for you ?
https://answers.splunk.com/answers/593401/how-to-allign-cell-values-of-table-in-splunk-dashb.html

Should be as simple as defining an ID for the table and then applying CSS to it.

Cheers,
David

0 Karma

rashi83
Path Finder

Thanks, how can I find dashboard css?

0 Karma

DavidHourani
Super Champion

check out the link it's all there ^^ and let me know if you're still stuck 🙂

0 Karma

rashi83
Path Finder

Hi David ,
I added following code at the end of the splunkjs-dashboard.css and restarted the splunk as well.

<<.table th, .table td{text-align: center!important}>>

I have added this as I want alignment for all tables. But still no luck !

0 Karma

DavidHourani
Super Champion

you should do it from the XML:

  <panel>
         <html depends="$alwaysHideCSS$">
             <style>
                   #table1 .table th, .table td {
                        text-align: center!important;
                    }
             </style>
         </html>
         ....

         <table id="table1">
             ....
         </table>

rashi83
Path Finder

Thanks David , it worked after putting it in XML

0 Karma

DavidHourani
Super Champion

most welcome ! please upvote and accept 🙂

0 Karma

rashi83
Path Finder

Already done 🙂

0 Karma
Get Updates on the Splunk Community!

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...