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!

Observability | How to Think About Instrumentation Overhead (White Paper)

Novice observability practitioners are often overly obsessed with performance. They might approach ...

Cloud Platform | Get Resiliency in the Cloud Event (Register Now!)

IDC Report: Enterprises Gain Higher Efficiency and Resiliency With Migration to Cloud  Today many enterprises ...

The Great Resilience Quest: 10th Leaderboard Update

The tenth leaderboard update (11.23-12.05) for The Great Resilience Quest is out &gt;&gt; As our brave ...