Interactive and dynamic multi-tabbed table with scrolling capability

After spending a considerable amount of time searching for a solution, I've come up short on finding an answer to this specific question. In my form, I have 3 tabs declared and within one of them, I aim to display a list of elements in a table. The challenge is to make this table occupy all available height space and be scrollable if the list exceeds the screen length.

<div id="tab_accounts_form" style="display:block">
    <div class="tab_form">
        <table class="list_tab_form">
            @foreach (Company item in ViewBag.CompanyList)
            {
                <tr class="row_tab_form">
                    <td class="col_rights_checkbox">
                        <input type="checkbox" id="@item.ID"/>
                    </td>
                    <td class="col_rights_label">
                        @item.CodeAndName
                    </td>
                </tr>
            }
        </table>
    </div>
</div>

Regarding the CSS:

.row_tab_form td
{
    height:19px;
    padding: 0 0 0 0;
}

.list_tab_form
{
    overflow-x: hidden;
    overflow-y: auto;
}

.tab_form
{
    width: 100%;
    height: 100%;
    margin: 2px ;
    position: relative;
    padding : 23px 0 0 0;
}

.tab_accounts_form
{
    height:100%;
}

The issue with the current code is that when the list is longer than the available height, it displays entirely without being scrollable, making the entire page scrollable instead. While setting a fixed height makes the list scrollable, ideally the height should be dynamic to accommodate various screen sizes.

Thank you for any assistance or suggestions!

Edit: Link to the fiddle example: http://jsfiddle.net/yo26bm0w/

Answer №1

After some experimentation, I discovered a solution by organizing my two blocks within a single row and two columns table structure. This method appears to be the most effective approach for achieving this.

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

What is the process for including a favicon on my website?

I am trying to add a favicon to my ASP website similar to this: https://i.sstatic.net/1dhXO.png After reading through these discussions: Image icon beside the site URL How to put an image on the tab bar next to the title of the page on the browser? I add ...

Eliminating boundaries of a button component

Recently, I noticed an issue with a button on my website: https://i.sstatic.net/5S6fS.png The button has the following custom styling applied to it: const SubmitButton = styled.button` width: 275px; height: 30px; background-color: red; ...

Is it feasible to have content wrap around a Grid-Item?

I've been experimenting with the new CSS Grids layout module to arrange my content. I have a set of paragraphs that are 8 columns wide, and I'm looking to insert a figure that spans 3 columns in columns 1-3. After that, I want the following parag ...

Guide to creating a mouseover effect where a hover div smoothly slides in from the side

Recently, I stumbled upon a WordPress theme that caught my attention: One particular feature that intrigued me was the translucent div that slides over a tile when hovered. After inspecting the page source, I am still unsure of the technique used to achie ...

My PHP file is throwing an error that involves converting an array to a string and an uncaught PDOException with the SQLSTATE[HY093] code

I'm encountering an issue with this file. Here are the error messages: Warning: Array to string conversion in C:\xampp\htdocs\backhaul-dispatcher\login\process.php on line 46. Fatal error: Uncaught PDOException: SQLSTATE[HY09 ...

Is there a tool available for iOS that can encode HTML?

While parsing XML, I encountered a link with accented characters like the one below: http://sale.images.woot.com/Château_de_Brigue_French_RoséhknStandard.jpg iOS seems to have trouble loading images with accented characters in the URL. When I manuall ...

When an element is focused using jQuery, allow another element to become clickable

I've been working on implementing an input field along with a dropdown list right next to it. The concept is that users can either type in the input field or choose a value from the dropdown list. I attempted to use styles to show the dropdown list wh ...

Submenu in submenu not registering CSS hover events

Currently, on a website project that I'm developing, there is a submenu nested within another submenu. Interestingly enough, the level-2 submenu happens to be taller than its parent level-1 submenu. To control the visibility of these submenus, I' ...

What is the best way to remove table row data fetched from an API within a table?

Can someone assist me with deleting the table tr from the user table, where data is retrieved from an API? I have attempted the code below: $("principleTable").find("tr").hide(); $("#delAgentModal").modal("hide"); ...

The title attribute fails to display the entirety of the content

My div has a title attribute with 4000 characters, but when I hover over it, the full content is not displayed. Is there a way to show the complete text? https://codesandbox.io/s/strange-hugle-mvwu5 ...

Enhancing BarGraph and Bars Size in Oracle ADF

We have created a web application using Oracle ADF. The application includes a page with a graph displayed below. Currently, we are looking to enlarge the bar graph by increasing its height, width, and size of the bars themselves. Difficulty 1: While we ...

Can you explain the conflict between using float and setting the height to 100% for divs?

Check out the following HTML code example: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> html, body { padding: 0; m ...

CSS menu - Shifting bar: What's the issue?

I'm struggling to add a moving bar to my website's navigation and need some help. I tried following a tutorial at the following link: (http://css-tricks.com/jquery-magicline-navigation/) Here is what I ended up with: If anyone could take a look ...

An additional div block positioned on top of another

I am attempting to create a compact gallery grid with three distinct elements as shown below: ----------------------- ----------------------- - - - - - - - - - ...

changing background color smoothly in a short time without using JQuery

Check out this link for some code .back { margin: 20px; padding: 100px; background: yellow; font-size: 30px; } <div class="back"> Fun place to stay. We got a golf cart to see the rest of the island, but the ...

Objects that incorporate a mixture of relative and absolute positioning properties

I am looking to display elements that are relatively positioned next to each other but absolutely positioned above everything else. You can view the desired rendering here and my attempt at achieving it in the fiddle below (or this codepen). Thank you! ...

Moving a Div to the Center of the Screen Using Jquery and Masonry JS

I am currently utilizing Jquery Transit and Masonry JS within my project. Within a specific div, there is a button which, when clicked, is intended to change the container's position to fixed and center it on the screen using Jquery Transit. However, ...

Bootstrap modal window allows users to interact with editable content in a sleek and

I have been tasked with a project that involves creating HTML table rows containing information such as Name, Details, Phone, Email, etc., all of which are stored in a database. My goal is to implement a modal box that will display the information from a ...

"The issue with the addClass function not properly executing within an if

I am trying to make a feature where the class changes based on my selection. The issue I am facing is that when I change it for the first time, it switches from being classified as "black" to "colored". However, upon changing it back, it remains labeled as ...

Padding issues in navbar-expand for Bootstrap 4

I'm encountering a strange issue with padding in my navbar that seems to be dependent on the navbar-expand property. For instance, when I set it to MD, it appears like this: https://i.sstatic.net/czytc.png As you can see, the logo and menu button d ...