Dashboards & Visualizations

change the table header alignment

anooshac
Communicator

The table header's alignments seem completely random. Some are aligned to the left and others are aligned to the right. Is there a way to make them all the same? I have already aligned the cells, but i am not getting how to align the header. Can anyone please help me in this?

Labels (1)
Tags (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Give your panel an id and add a (hidden) panel of html with some styling

        <style>
          #id_of_panel th.numeric {
            text-align: left !important;
          }
        </style>

View solution in original post

0 Karma

anooshac
Communicator

yes.. I have a table with numeric and non-numeric values, together they look odd, is there any method by which i can align numeric and non-numeric to the same side?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Give your panel an id and add a (hidden) panel of html with some styling

        <style>
          #id_of_panel th.numeric {
            text-align: left !important;
          }
        </style>
0 Karma

anooshac
Communicator

Thank you so much for this! its working properly..

I have one more doubt.. Same should be done for the non-numeric values too right? Because i want all the values to be aligned to the center..

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Yes, you would need to do non-numerics as well if you want to override the default left alignment

0 Karma

anooshac
Communicator

#table .table thead th.string, .table tbody tr td.string{
text-align:center !important;
}

Is this the right way to do that? I am sorry if it has mistakes..

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Non-numerics don't have a specific class, they will take the default, so you would need to change the default (and possibly the numeric as well) i.e. just th (and td if you want the data to align as well)

0 Karma

anooshac
Communicator

okay.. Thank you so much!

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Aren't the headers aligned similarly to the data i.e. non-numeric to the left and numeric to the right?

0 Karma
Get Updates on the Splunk Community!

Improve Your Security Posture

Watch NowImprove Your Security PostureCustomers are at the center of everything we do at Splunk and security ...

Maximize the Value from Microsoft Defender with Splunk

 Watch NowJoin Splunk and Sens Consulting for this Security Edition Tech TalkWho should attend:  Security ...

This Week's Community Digest - Splunk Community Happenings [6.27.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...