Dashboards & Visualizations

How to align numbers in the center of a dashboard?

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

SplunkTrust
SplunkTrust

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

SplunkTrust
SplunkTrust

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

Explorer

Thanks, how can I find dashboard css?

0 Karma

SplunkTrust
SplunkTrust

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

0 Karma

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

SplunkTrust
SplunkTrust

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>

Explorer

Thanks David , it worked after putting it in XML

0 Karma

SplunkTrust
SplunkTrust

most welcome ! please upvote and accept 🙂

0 Karma

Explorer

Already done 🙂

0 Karma