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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...