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!

Developer Spotlight with Brett Adams

In our third Spotlight feature, we're excited to shine a light on Brett—a Splunk consultant, innovative ...

Index This | What can you do to make 55,555 equal 500?

April 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...