Ways to enable this feature to function

I am working with a div that contains multiple tables structured like this:

<div id="div1">
  <div id="div2">
        <div id="div3">
            <table id="table1"><tr><td></td></tr></table>
            <table id="table2">
                <tr></td></td></td></td></tr>
                <tr></td></td></td></td></tr>
            </table>
        </div>
  </div>

</div>

My issue is that when table2 has many rows, I use CSS overflow to show horizontal scroll bars. However, these scroll bars also affect table1 as it scrolls down along with the rest of the content. How can I make sure that table1 remains fixed and does not scroll down?

Thank you for any help!

Answer №1

Styling with CSS When styling tables, a max-height of 200px can be applied.

tbody {
 height: 180px;
 overflow:auto;
}

Using HTML

<table id="table2">
 <tbody>
  <tr></td></td></td></td></tr>
  <tr></td></td></td></td></tr>
 <tbody>
</table>

For further details and explanation, visit:

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

Incorporate dynamic animations into text wrapping using React

Currently, I am in the process of learning React and have successfully created a flexbox with 6 child containers using the wrap property. Now, I am looking to add animation when the containers wrap onto a new line. I attempted to add a transition animatio ...

Organizing an array of objects within MUI cards based on social media platforms

I'm currently developing an application that showcases athlete data in a grid layout using MUI Grid. The colored borders on the left side of each card are determined by the corresponding social network associated with that athlete. https://i.sstatic. ...

Attempting to create a child process within the renderer by triggering it with a button click

I'm currently developing an electron application where I am attempting to initiate a child node process (specifically to run a Discord.JS bot). Below is the code snippet in question: index.html: <tr> <th class="title-bar-cell" ...

What is the best way to dynamically insert a new row into a table, with each row containing a table heading and column?

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <table id="tbl" class="tbl1"> <tr> <th> mobileno </th> <td class='mo' id="mo_0"> </td> ...

Using jQuery to validate the existence of a link

Within my pagination div, I have links to the previous page and next page. The link to the previous page is structured as follows: <span id="previous"><a href="www.site.com/page/1" >Previous</a>. However, on the first page, there will be ...

Looking to insert an image in the top-left corner of a div?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> <head> <script src="http://ajax.googleapis.com/ajax/libs/jq ...

I am facing an issue where the text on my website is failing to display properly

I am facing an issue where the text on my website renders normally on Android or Windows, but when I run it on iOS, the text disappears completely. It's as if all the text has been set to display: none; The other elements seem to be tucking in just fi ...

Send form data using ajax technology

When testing my code on localhost, everything runs smoothly. However, when I tried running it on the server, it doesn't seem to be functioning properly. $("#MyUploadForm").ajaxSubmit(options); I would greatly appreciate any assistance with t ...

What is the process for making Bootstrap tables editable?

In my current project, I am utilizing Bootstrap version 5. During the development process, I encountered a requirement to make my bootstrap table editable, allowing users to modify cell values as needed. However, I discovered that the x-editable feature, ...

The tubular.js Youtube video background is overlapping my other components on the site, instead of displaying behind them as intended

I recently implemented the tubular.js script on my webpage to display a YouTube video as the background. On the tubular page, there is a statement that reads: First, it assumes you have a single wrapper element under the body tag that envelops all of ...

Tips for transmitting one or multiple data using jquery.ajax

I found this code on stackoverflow and it is working well for uploading multiple files. However, I am facing an issue where I cannot send additional parameters along with the file upload. Despite trying various methods, I have been unsuccessful in sending ...

Troubleshooting issues with the sidebar navigation in Laravel project using Vue and AdminLTE

I successfully installed AminLte v3 via npm in my Laravel + vue project and everything is functioning properly. However, I am facing an issue when I attempt to click on the main menu item in the Side navbar that is labeled as <li class="nav-item has-tr ...

Social Count Total Using AddThis HTML Plugin

Our Blog uses AddThis to enable sharing of our posts. We want to track the total number of shares across all networks in one consolidated section, rather than displaying individual share counts for each network. This is the current code snippet: < ...

What is the process for assigning a background color to a specific option?

Trying to create a dropdown menu with various options and colors. Managed to set background colors for each option, but once an option is selected, the background color disappears. Is there a way to fix this issue? See my HTML example below: <select> ...

Dealing with full-width elements on mobile devices

I've got a pretty basic question here but can't seem to find a straightforward answer. I'm using Bootstrap to style a website and struggling with making it mobile-responsive. Following the given answer, I used this code to show a button ne ...

A guide on incorporating text into a file utilizing JSP within HTML

I am working on a project that includes a JSP file and a .txt file. The JSP file contains a text field and a button, where the user can enter a text and click the button to store it in the .txt file. I have provided my code below, but I seem to be missin ...

Can anyone tell me the best way to access the name attribute of an HTML element in TypeScript?

Currently, my code is utilizing the name attribute to verify whether the user has entered information in a specific field and validating the input. However, I am facing an issue where the submit button remains active even if there are empty fields presen ...

CSS can only fade out without hiding afterwards

I'm struggling to create a CSS class and animation that will fade out or move a div along with its contents, resulting in the div having both display:none and visibility:hidden My attempts so far have been unsuccessful! I can either get the animation ...

CSS animation for image hover effect in Revolution Slider

I'm currently facing an issue while using Revolution Slider. To better illustrate, I am referring to the original demo found at this link: . When browsing through the 'portfolio' tab, you'll notice that the images shrink and darken upo ...

Randomize elements with the click of a button

Every time the page refreshes, the words shuffle around. For instance, "May I# know# your name?" shuffles to "know May I your name". To display the correct sentence with "#" as "May I know your name?", click the SHUFFLE button to trigger the shuffling. HT ...