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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...