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!

.conf25 Registration is OPEN!

Ready. Set. Splunk! Your favorite Splunk user event is back and better than ever. Get ready for more technical ...

Detecting Cross-Channel Fraud with Splunk

This article is the final installment in our three-part series exploring fraud detection techniques using ...

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...