Dashboards & Visualizations

How to align numbers in the center of a dashboard?

rashi83
Explorer

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

View solution in original post

0 Karma

rashi83
Explorer

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
Explorer

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
Explorer

Thanks David , it worked after putting it in XML

0 Karma

DavidHourani
Super Champion

most welcome ! please upvote and accept 🙂

0 Karma

rashi83
Explorer

Already done 🙂

0 Karma
Did you miss .conf21 Virtual?

Good news! The event's keynotes and many of its breakout sessions are now available online, and still totally FREE!