What methods can be used to display the inner element's scrollbar within the outer element?

In our work interface, there is a not-so-appealing table structure that displays potentially large outputs of queries. I must admit, my experience with web development is quite limited.

The layout looks something like this:

<div class = "view_scroll_outer">
        <table class = "scrollTableHeader" ...>
        <div class = "view_scroll_inner" ...>
            <table ...>
                  ... content here
        <table class = "scrollTableFooter" ...>

A) The ScrollTableHeader table holds the columns for the final viewable data table.

B) Inside the inner <div> element is where the rows of the final table (with the data) are located.

For now, I am unable to modify this structure - that will have to wait until next month. However, there are some issues with this setup. While I have addressed several of them, one in particular is causing me frustration.

Imagine if the data is extensive in width (many columns and rows). This configuration presents a problem as the columns fall under the outer <div> element, requiring the horizontal scrollbar to appear on the outer box. Yet, the vertical scrollbar is within the inner container since it contains the data rows. Consequently, users have to scroll all the way right on the outer table just to access the vertical scroll bar in the inner box.

Here's what I've attempted so far:

1) Adjusting the width of the inner div box

document.getElementsByClassName('view_scroll_inner')[0].style.width = (visWidth * 0.99) +'px'; //visWidth represents the visual area width

This only results in cutting off columns beyond the visible area

2) Modifying the width of the outer div box

document.getElementsByClassName('view_scroll_outer')[0].style.width = (visWidth * 0.99) +'px';

This seems to produce a similar outcome.

At this point, aside from completely revamping the design (which I plan to do in a month), the only other potential solution that comes to mind is finding a vertical scrollbar that remains at the right end of what you're viewing, rather than the window's right end. This would enable the scrollbar to track along the right side of the visible box as you scroll horizontally in the outer container.

Does anyone know of any scrollbars designed this way? Or perhaps have suggestions for any alternate solutions?

Answer №1

Implement the external jQuery Scrollbar plugin to easily add custom scrollbars to any element on your webpage. Check out the demo for advanced scrollbars.

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

Can an array be generated on-the-fly with objects contained within it?

Seeking advice on looping through an array of objects to achieve a specific result. Here is the initial array: var testArray = [{'name':'name1', 'xaxis':'xaxis1', 'yaxis':'yaxis1'}, ...

Enabling the focusability of a div element through a click event

I am working on a div that contains a THREE.js visualization and I am trying to make it focusable when clicked. I have experimented with changing the tabindex to 1 or -1, however, while setting it to 1 allows the element to be focused using tab, neither op ...

NuxtJS (Vue) loop displaying inaccurate information

I have a dataset that includes multiple languages and their corresponding pages. export const myData = [ { id: 1, lang: "it", items: [ { id: 1, title: "IT Page1", }, { ...

What is the best way to create a binary trie with nodes that can process 4 bits simultaneously?

I am currently exploring ways to organize a binary trie in a more streamlined manner. Typically, a binary trie consists of nodes for each slot in a binary number, branching left on 0 and right on 1. Is it possible to read 4 bits at a time instead of just 1 ...

Encountering an issue with the Bootstrap modal popup not functioning properly within a JSP file, implemented alongside the Apache Tiles framework

In my Spring Boot web application, I have incorporated Bootstrap with features like SB Admin and data tables, all of which are functioning correctly. However, I am facing an issue with implementing a Bootstrap modal popup. Below is my JSP code: <%@ ...

Utilizing a material-ui button within a React application as the trigger for a Popup using MuiThemeProvider

I want to trigger a Popup in React using a button with a custom theme: <PopUp modal trigger={ <MuiThemeProvider theme={buttonTheme}> <Button variant="contained" color="secondary">Excluir& ...

Complete the transparent logo by showing the progress of the page loading

I am pondering the idea of filling in a logo based on the percentage of the page load. My initial thoughts are to use a gif, but I wonder if syncing a gif with the % of page load is really possible. Another idea is to have 100 images that change out depen ...

Trouble with AngularJS not redirecting to home page after logging in

My current setup involves spring + angularJS, and I'm facing an issue where after authentication from the controller, I'm unable to redirect to the home page. console.log("id:"+employee.id); alert("Attempting to redirect to the home page") ...

Can stringByEvaluatingJavaScriptFromString be utilized with JavaScript that makes references to local files?

     I am looking to implement stringByEvaluatingJavaScriptFromString in order to execute a JavaScript code that accesses local files (such as CSS or JS files) stored on the device (presumably in the Documents folder)... NSString *theJS = [[NSString ...

Using jQuery bootgrid: Sending PHP data through AJAX

I'm currently using the jQuery bootgrid along with AJAX for server-side processing. I am attempting to pass a PHP variable to the processing script through AJAX, but unfortunately, I haven't been successful in getting it to work. Here is the cod ...

Using select and options with the AIRA input fields names incorrectly

Hello, I'm struggling with how to effectively manage this fields in order to resolve the issue of "ARIA input fields do not have accessible names." Whenever I test the website, it brings up this particular issue. Any advice on how to tackle this? < ...

Is there a way to dynamically change an icon based on certain conditions using typescript?

I am struggling with displaying icons in my TypeScript code using Material Icons. I need to dynamically change the icon based on a condition, for example if the power is false I want to display 'power_off', but if it's true then I want to di ...

Page callback triggers duplicate Ajax request

I created an ajax script that loads the requested page into a #container div in PHP. When I call the project.html page, the request works fine, loading the page and its associated $getscript. However, when I try to call back my home page, the requests are ...

Ways to conceal a division by selecting an anchor button on this element

One thing I'm curious about is how to hide only the current div that I click on. Any suggestions on how to achieve that? $('.ads-close-btn').click(function() { $('.full-width-add').hide("slow"); }); alert('My main qu ...

Search for data in Mongoose by utilizing a query object that has been obtained from a query string

After extracting and parsing a querystring from a URL, I am able to map it into an object structure like this: { '$and': [ { length: { '$gt': '2' } }, { length: { '$lt': '55555' } } ] } This object is st ...

Continuous Looping jQuery Horizontal Stock Ticker

In my HTML page, I have integrated the jStockticker as shown below: <div id="ticker" class="stockTicker" style="width: 100%"> <span class="quote">Stock Quotes: </span> <span id="tickerValues-AAPL"> <spa ...

Exploring Express-HandleBars within a Node.js Environment

I encountered a template render error while using the # token in my hbs file. Despite installing all dependencies correctly, I am unsure of how to resolve this issue or why it is happening. app.get('/h',function(req,res) { username = req.s ...

Deleting Data with HTML Using the HTTP DELETE Method

I've encountered an issue with making HTTP DELETE requests in webapp2. Currently, I've resorted to using a different URI with GET method as a temporary workaround. However, I'd prefer to implement a more RESTful approach. Upon inspecting th ...

What is the process for retrieving data submitted in JSON format?

Hello there! Programming Query: $("#user-search_input").autocomplete({ source: function( request, response ) { var form_data=$("#user-search_input").val(); $.ajax({ url: "./AutoCompliteFind/", dataType: "json", typ ...

What is the best way to use JQuery to bring a blogger post H3 in front of an image?

Currently, I am in the process of customizing a template on Blogger. The Blog gadget automatically places the heading before the blog image within the DOM structure. However, my goal is to implement a hover effect over the image where the text on top links ...