How to activate the horizontal scrollbar in a jqgrid table

How can I enable horizontal scroll in jqgrid when the grouped text is longer than the table width?

The table width is set to approximately 50% of the screen, but when the grouping text exceeds 300 characters, adding overflow property results in the text getting hidden without a scroll bar.

See the highlighted line in the image below for reference: https://i.sstatic.net/Qzyax.png

Answer №1

To resolve the issue, try adding the overflow-y:scroll property to your table.

Ensure that shrinkToFit : false is set or adjust your element as mentioned above.

<div style="width:100px;overflow:auto;"><table id="yourTable"></table><div>

You can achieve this using CSS.

yourTableSelector{
      width:50%;
      overflow-y:scroll;
       }

Here's an illustration:

.scrolling-wrapper {
  height:100px;
 width:50%;
 border:1px solid red;
  overflow-y: scroll;
 
}
 
<div class="scrolling-wrapper">
  <div>There are two different ways to make these divs scroll horizontally and which path you choose will probably come down to personal preference and/or browser support.
  There are two different ways to make these divs scroll horizontally and which path you choose will probably come down to personal preference and/or browser support.
  There are two different ways to make these divs scroll horizontally and which path you choose will probably come down to personal preference and/or browser support.</div> 
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Add data to a size guide

My coding project involved creating a sizing chart using HTML, CSS, and JavaScript. The chart allows users to select their preferred units of measurement (metric or imperial). I used JavaScript to dynamically update the values in the chart based on the sel ...

The background image allows the top images and headers to overlay, while ensuring that the other images and headers remain below

As a novice in HTML and CSS, I'm facing a puzzling issue while learning at school. The first header and two images within the container where my background image is placed are overlapping the background image, creating a large gap. Strangely, the subs ...

What is the best way to responsively scale multiple overlay images in CSS?

I am facing an issue with multiple images overlaid on top of a background in my web design. Here's a sample code snippet that showcases the problem: <div style="position: relative; left: 0; top: 0;"> <img src="images/background.png" styl ...

Is there a way to align input fields alongside the center of their corresponding labels?

Let me illustrate the issue I am encountering: https://jsfiddle.net/v10un11s/1/ Here is the snippet of my HTML code: <div> <div class="component"> <div> <label for="test1" id="short-label">Short label: </label&g ...

The z-index property does not seem to function properly when used in conjunction

I am experiencing an issue with the z-indexes of two divs: one with default positioning and the other with a fixed position. No matter how I adjust the z-index values, it appears impossible to make the fixed-positioned element go behind the statically pos ...

Is it necessary to create a separate animation class to trigger CSS keyframe animations based on scroll position?

My website has a background animation that controls various shapes, each with their own unique animation styles: animation: animShape 50s linear infinite; The speed of the animations varies depending on the shape being displayed. The animShape keyframes ...

Animate the centering of a DIV

Currently, I am working on an animation featuring a series of DIV's contained within a div with the identifier id="wrapper", all styled using CSS3. However, when I hover over the rounded box, the animation is not properly aligned in the center. You ca ...

Adjust the size of every card in a row when one card is resized

At the top of the page, I have four cards that are visible. Each card's height adjusts based on its content and will resize when the window size is changed. My goal is to ensure that all cards in the same row have equal heights. To see a demo, visit: ...

Stretch the div to the right and maintain its horizontal width

I am in the process of coding a two-column layout, with a total width of 980px. Each column will have a background that expands all the way to the left and right sides as shown in the screenshot here. On the left side, there is a blue div with a width of ...

Modify anchor link color in a one-page website by using Jquery to detect scroll position changes when reaching different page sections

Each if statement contains specific numbers to change the text color of the visited/current/active anchor link. The height of the page is dependent on its width. How can this be resolved? Apologies if my explanation is confusing, English isn't my stro ...

"Is there a way to modify the color of the button once it's been clicked, but only for the specific button that was

Looking to create a Quiz App using React and facing an issue where all buttons change color when clicked, instead of just the one that was clicked. Any solutions on how to make only the clicked button change its color in React.js? App.js import Main from ...

DIV that floats and P element

When utilizing the float attribute, two div elements align next to each other, but two paragraph elements do not; causing the 'p' element to display oddly. Interestingly, when floating two 'div' elements and two 'p' elements, ...

Diverse Browser Image Mapping Coordinates

I am in the process of creating an image map, where I specify coordinates on an image that link to other pages. However, I'm encountering an issue where the position of these coordinates is not relative. When viewing the image on a different browser ...

Is it possible to install non-root dependencies in node_modules using NPM?

The repository @superflycss/component-navbox contains the following list of dependencies: "devDependencies": { "@superflycss/component-body": "^1.0.1", "@superflycss/component-display": "^1.0.2", "@superflycss/component-header" ...

When it comes to handling media queries, iPhone is geared towards min-width dimensions of 768

The layout of my landing page has a CSS structure that looks like this: body { background: white; } @media (min-width: 768px) { body { background: red; } } @media (max-width: 767px) { body { background: blue; } } Des ...

Fine-tuning the page design

I'm working on a registration page using Bootstrap-5 for the layout. Is there a way to place all elements of the second row (starting with %MP1) on the same row, including the last field that is currently on the third row? See image below: https://i. ...

Send the image link as a parameter

I've been trying to pass an image link through two child components, but I'm having trouble. I added the link to the state and passed it down, but it doesn't work. Strangely, when I manually input the link in the child component, it works pe ...

What is the best way to generate a CSS design with wavy patterns?

Check out the image below to see what I am attempting to create: https://i.sstatic.net/PlroF.png Here is my current code, but I need to make it more dynamic, similar to increasing the frequency rate of a sin or cosine wave. #wave { position: relativ ...

jQuery: Function is not running as expected

I'm facing a challenge in executing a function twice, and I'm having trouble identifying the issue. Check out my JSFiddle at the following link: http://jsfiddle.net/g6PLu/3/ Javascript function truncate() { $(this).addClass('closed&apo ...

divs placed next to each other

I'm facing an issue with 4 divs within a parent div. I've used float:left in the style of all 4 divs to display them side by side. Although the divs are appearing next to each other, the height of the parent div is not adjusting to accommodate th ...