Dashboards & Visualizations

how to allign cell values of table in splunk dashboard

surekhasplunk
Communicator

i want to allign all the cell values along with the header values to center in splunk dashboard. How do i achieve it.

Tags (2)
0 Karma
1 Solution

niketn
Legend

@surekhasplunk, Similar question was answered yesterday: https://answers.splunk.com/answers/412272/align-the-first-column-of-the-table.html
For a table with id="table1", following is CSS style override code:

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

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

Please try out and confirm.

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

View solution in original post

niketn
Legend

@surekhasplunk, Similar question was answered yesterday: https://answers.splunk.com/answers/412272/align-the-first-column-of-the-table.html
For a table with id="table1", following is CSS style override code:

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

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

Please try out and confirm.

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

marceloalejandr
Path Finder

Can anyone please advise if this applies to Splunk v7.3.3 or if there is something else needed?   We tried applying this but it did not align the table.   Thank you.

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

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

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi surekhasplunk,
to change default alignment rules in table cells, you have to modify dashboard's CSS.
Bye.
Giuseppe

psherman42
Engager

You can focus it to the first column with something like this inside the <panel>

<html depends="$alwaysHideCSS$">
    <style>
        /* Right align only the first column of the table */
        #table1 .table th:nth-child(1),
        #table1 .table td:nth-child(1) {
            text-align: right!important;
        }
    </style>
</html>
0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

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