All Apps and Add-ons

Make SimpleResultsTable Header Title take up 2 lines

cmak
Contributor

My table headers are extremely long, so I would like to have the header names take up 2 or more lines. Ideally, I do not want to use aliases since it shortens the name and is less descriptive. Is there a way to do this?

1 Solution

sideview
SplunkTrust
SplunkTrust

If you're using the Sideview Table module, you could put this into your application.css file.

.Table tr.columnRow th {
  white-space:normal
}

and that would remove the 'nowrap' style that affects the column headers, across all views in the entire app.

If you wanted to be a little more careful and only apply the change to a particular view, and lets say the view is called "myView", you would instead do:

.splView-myView .Table tr.columnRow th {
  white-space:normal
}

And if you're using the Splunk SimpleResultsTable, I think you can do something similar:

.splView-myView .SimpleResultsTable table.simpleResultsTable {
    white-space: normal;
}

Note that it might now wrap to 2 lines, or to 3 lines, or to 8 lines, depending on how crazy long your column headers are.

View solution in original post

sideview
SplunkTrust
SplunkTrust

If you're using the Sideview Table module, you could put this into your application.css file.

.Table tr.columnRow th {
  white-space:normal
}

and that would remove the 'nowrap' style that affects the column headers, across all views in the entire app.

If you wanted to be a little more careful and only apply the change to a particular view, and lets say the view is called "myView", you would instead do:

.splView-myView .Table tr.columnRow th {
  white-space:normal
}

And if you're using the Splunk SimpleResultsTable, I think you can do something similar:

.splView-myView .SimpleResultsTable table.simpleResultsTable {
    white-space: normal;
}

Note that it might now wrap to 2 lines, or to 3 lines, or to 8 lines, depending on how crazy long your column headers are.

cmak
Contributor

The problem with this solution is that my labels are a single long word. Also, the labels are in elements so in order to force it to be a certain width, I need to set it as an inline block. It still does not wrap, and will simply be hidden behind the next column.

0 Karma

cmak
Contributor

I have been trying out CSS properties such as these :
http://stackoverflow.com/questions/1258416/word-wrap-in-a-html-table

But this does not seem to work for the table headers in Splunk

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 ...