Splunk Search

table with custom width for column

DataOrg
Builder

I have around 15 columns in table , where i want to have fixed column width for 3columns with 30px and other remaining column with 15px to accommodate in single view 100%

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

ITWhisperer
SplunkTrust
SplunkTrust

Use a hidden panel with some style

 

    <panel depends="$alwaysHideCSSPanel$">
      <html>
        <style>
          #tableWithFixedColumnWidth th,
          #tableWithFixedColumnWidth td {
              width: 15px !important;
              overflow-wrap: anywhere !important;
          }
          #tableWithFixedColumnWidth th:nth-child(1),
          #tableWithFixedColumnWidth td:nth-child(1),
          #tableWithFixedColumnWidth th:nth-child(2),
          #tableWithFixedColumnWidth td:nth-child(2),
          #tableWithFixedColumnWidth th:nth-child(3),
          #tableWithFixedColumnWidth td:nth-child(3) {
              width: 30px !important;
              overflow-wrap: anywhere !important;
          }
        </style>
      </html>
    </panel>
    <panel>
      <table id="tableWithFixedColumnWidth">

 

You should set styles for header and data elements

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Use a hidden panel with some style

 

    <panel depends="$alwaysHideCSSPanel$">
      <html>
        <style>
          #tableWithFixedColumnWidth th,
          #tableWithFixedColumnWidth td {
              width: 15px !important;
              overflow-wrap: anywhere !important;
          }
          #tableWithFixedColumnWidth th:nth-child(1),
          #tableWithFixedColumnWidth td:nth-child(1),
          #tableWithFixedColumnWidth th:nth-child(2),
          #tableWithFixedColumnWidth td:nth-child(2),
          #tableWithFixedColumnWidth th:nth-child(3),
          #tableWithFixedColumnWidth td:nth-child(3) {
              width: 30px !important;
              overflow-wrap: anywhere !important;
          }
        </style>
      </html>
    </panel>
    <panel>
      <table id="tableWithFixedColumnWidth">

 

You should set styles for header and data elements

0 Karma

DataOrg
Builder

@ITWhisperer perfect worked well 🙂

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...