All Apps and Add-ons

Sideview Utils: How can I remove table headers?

Simon
Contributor

Hi All

I'm using Sideview Utils Table module to display my results. Howewer, I only have two columns, where the first column is the label for the value displayed in the second column (I flipped the table with "transpose").
So in my case, I don't need the table header.
How can I hide the table header containing the automated generated field names by tranpose?

Thanks
Simon

1 Solution

sideview
SplunkTrust
SplunkTrust

Well, it sounds like a strange use case, but the only way I can think of do to what you ask is to put in some custom CSS. The column row has the classname "columnRow", so you could put this custom CSS into application.css

.your_view_name_here .Table .columnRow {
    display:none;
}

and it would hide the column row. Can you describe a few more details of your situation. It sounds strange enough that maybe we can help you think of another way to do what you need?

UPDATE::

1) Sorry I messed up the sample CSS. Indeed as you discovered it should have been

.splView-your_view_name_here .Table .columnRow {
    display:none;
}

2) I totally get what you're trying to do.

a) one way is that instead of worrying about trying to eliminate the weird "column" and "row1" field names, just rename them to less weird names, ie | rename column as type row1 as duration.

b) Or, if you know in advance ALL of the TIME_* values, and you know that they will all always be populated, and there is only a small number of them, and getting the exact table-formatting you want is more important than the sorting and drilldown functionality, then then you can use the HTML module to render the html any way you like it. (Note if ANY of those aren't true you're better off not doing it this way but using Pager + Table instead).

here's how:

-- There's really no need for the transpose, in fact with this strategy it's much simpler without it. So remove the transpose, and that will take you back to having just that single-row search result. Note in the next bullet we use the HTML module's internal syntax of $results[0].fieldName$, and the [0] reflects that all our fields are in a single row, ie there's no transpose at work.

-- Now that you've removed your transpose command, instead of the Pager + Table combination, you would just have an HTML module.

<module name="HTML">
  <param name="html"><![CDATA[
    <table class="splTable">
      <tr>
        <td>uptime</td>
        <td>$results[0].TIME_UP$</td>
      </tr>
      <tr>
        <td>downtime</td>
        <td>$results[0].TIME_DOWN$</td>
      </tr>
      <tr>
        <td>maintenance</td>
        <td>$results[0].TIME_MAINTENANCE$</td>
      </tr>
    </table>
  ]]></param>
</module>

View solution in original post

sideview
SplunkTrust
SplunkTrust

Well, it sounds like a strange use case, but the only way I can think of do to what you ask is to put in some custom CSS. The column row has the classname "columnRow", so you could put this custom CSS into application.css

.your_view_name_here .Table .columnRow {
    display:none;
}

and it would hide the column row. Can you describe a few more details of your situation. It sounds strange enough that maybe we can help you think of another way to do what you need?

UPDATE::

1) Sorry I messed up the sample CSS. Indeed as you discovered it should have been

.splView-your_view_name_here .Table .columnRow {
    display:none;
}

2) I totally get what you're trying to do.

a) one way is that instead of worrying about trying to eliminate the weird "column" and "row1" field names, just rename them to less weird names, ie | rename column as type row1 as duration.

b) Or, if you know in advance ALL of the TIME_* values, and you know that they will all always be populated, and there is only a small number of them, and getting the exact table-formatting you want is more important than the sorting and drilldown functionality, then then you can use the HTML module to render the html any way you like it. (Note if ANY of those aren't true you're better off not doing it this way but using Pager + Table instead).

here's how:

-- There's really no need for the transpose, in fact with this strategy it's much simpler without it. So remove the transpose, and that will take you back to having just that single-row search result. Note in the next bullet we use the HTML module's internal syntax of $results[0].fieldName$, and the [0] reflects that all our fields are in a single row, ie there's no transpose at work.

-- Now that you've removed your transpose command, instead of the Pager + Table combination, you would just have an HTML module.

<module name="HTML">
  <param name="html"><![CDATA[
    <table class="splTable">
      <tr>
        <td>uptime</td>
        <td>$results[0].TIME_UP$</td>
      </tr>
      <tr>
        <td>downtime</td>
        <td>$results[0].TIME_DOWN$</td>
      </tr>
      <tr>
        <td>maintenance</td>
        <td>$results[0].TIME_MAINTENANCE$</td>
      </tr>
    </table>
  ]]></param>
</module>

Simon
Contributor

I had to use
.splView-_your_view_name_here .splTable .columnRow
But then, it works like a charm!

Well, the point is, I have some statistics in a table, e.g.:
TIME_DOWN | TIME_UP | TIME_MAINTENANCE
3h | 2h | 1h

With transpose I'm flipping the table:

column | row1
TIME_DOWN | 3h
TIME_UP | 2h
TIME_MAINTENANCE | 1h

So actually I don't need the first row with the column identifiers anymore.

In fact, I wan't to print multiple single values table-formatted. That's why I wanted to hide the columnRow.

Does that make sense?

0 Karma

lakshmisri
New Member

I have a similar problem. I am using splunk view / splunk table visualization to display the results.

Without the header, I need just the values. I am using the below css. I want to remove it only for one of the panels in the dashboard. But this is not working

problem_response_compliance .shared-resultstable-resultstableheader {

 display:none;

}

0 Karma

sideview
SplunkTrust
SplunkTrust

From this CSS I think you're not using Sideview Utils, but rather a core Splunk simple xml dashboard. Although the same thing can probably be done in that system, I'm afraid I'm hesitant to give advice without knowing whether it would work long term. You can certainly use DOM inspectors (like the Firebug add on for Firefox) to explore what the classnames actually are in the DOM and why your CSS selectors aren't matching or are matching too aggressively.

0 Karma

lakshmisri
New Member

Hi.. I have got it working. Sometimes its very odd but this one finally worked

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...