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 Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...