The scroll bar remains hidden even though there are additional elements waiting to be displayed

I am currently utilizing asp.net along with entity framework 4

On my page, I have three tabs structured like this:

The Challenge I'm Facing

The issue I am encountering is that the browser fails to display a scrollbar even when there are over 150 rows present in the table.

Here is the CSS of my table:

.tableResultClass{
        overflow:hidden;
        border:1px solid #d3d3d3;
        background:#fefefe;
        width:90%;
        margin:5% auto 0;
        -moz-border-radius:5px; /* FF1+ */
        -webkit-border-radius:5px; /* Saf3-4 */
        border-radius:5px;
        -moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
        -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);

If you require any additional information to understand and address my problem, please let me know. Thank you in advance.

The Entire ASP Code

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    <div id="onlineBookingDiv" style="float: right; position:fixed; right:0px; width:400px">
                <div id="tabs">
                    <ul>
                        <li><a href="#tabs-1">Today</a></li>
                        <li><a href="#tabs-2">Tomorrow</a></li>
                        <li><a href="#tabs-3">Any Date</a></li>
                        <label style="float: right">
                            <asp:DropDownList AutoPostBack="true" runat="server" ID="mealTimeSelector" OnSelectedIndexChanged="TodayTab_Click">
                                <asp:ListItem Value="1">Breakfast</asp:ListItem>
                                <asp:ListItem Value="2">Lunch</asp:ListItem>
                                <asp:ListItem Value="3">Dinner</asp:ListItem>
                            </asp:DropDownList>
                        </label>
                    </ul>
                    <div id="tabs-1">
                        <asp:ScriptManager ID="ScriptManager2" runat="server" />
                        <asp:UpdatePanel ID="UpdatePanel3" UpdateMode="Conditional" runat="server">
                            <ContentTemplate>
                                <table id="BookingTable" runat="server" class="tableResultClass">
                                    <tr>
                                        <th>ID</th>
                                        <th>PlanTime</th>
                                    </tr>
                                </table>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="mealTimeSelector" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </div>
                    <div id="tabs-2">
                        
                        <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server">
                            <ContentTemplate>
                                <table id="BookingTableTomorrow" runat="server" class="tableResultClass">
                                    <tr>
                                        <th>ID</th>
                                        <th>PlanTime</th>
                                    </tr>
                                </table>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="mealTimeSelector" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </div>
                    <div id="tabs-3">
                        <p>
                            Date:
                    <input type="text" id="datepicker" runat="server" ClientIDMode="Static">
                        </p>


                        <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
                            <ContentTemplate>
                                <asp:Button ID="BookingForDate" runat="server" OnClick="BookingForDate_Click" Text="Search" />
                                <span style="color: red" id="errorDateMessage" runat="server"></span>
                                
                                <table id="DateBookingTable" runat="server" class="tableResultClass">
                                    <tr>
                                        <th>ID</th>
                                        <th>PlanTime</th>
                                    </tr>
                                </table>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="mealTimeSelector" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </div>
                </div>
        </div>

Answer №1

this overflow:hidden; is the reason why the scroll is not appearing, so you can either:

overflow:scroll;

or

 overflow:auto;

.

.tableResultClass{
        overflow:scroll;  //or use auto
       min-height:100px;  //use min-height
        border:1px solid #d3d3d3;
        background:#fefefe;
        width:90%;
        margin:5% auto 0;
        -moz-border-radius:5px; /* FF1+ */
        -webkit-border-radius:5px; /* Saf3-4 */
        border-radius:5px;
        -moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
        -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

However, if you want to hide the horizontal overflow, simply use:

overflow-x:hidden;

Note: remember to specify a min-height:*yourvalue*px

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

How can I hover over multiple cells in a table?

Is there a way to change the color of multiple adjacent cells when hovering over one cell, and can this be done dynamically (so the number of adjacent cells that change color can vary)? Here is the code snippet: I'm using React to create a table wit ...

In Firefox, certain scroll positions cause elements to vanish

I've been struggling with a peculiar bug that I can't seem to fix. The issue arises in Firefox when scrolling on a MacBook Pro 2019 15" at 1680x1050 resolution - product elements (not just images) begin to flicker. I have recorded a video of th ...

Ways to modify the height of a button without impacting other buttons?

My goal is to create a calculator that looks like the image attached below: However, I'm having trouble aligning the equal button properly. How can I adjust it to match the equal button in the image? Here's the code snippet I'm currently w ...

The buttons mysteriously vanish when hovered over in Internet Explorer 11

I've encountered a strange issue with my website www.webfounded.com when viewed in Internet Explorer - all of my bootstrap buttons disappear on hover! Despite adding CSS classes for multiple browser compatibility and even attempting to remove the hove ...

Exploring creative methods for incorporating images in checkboxes with CSS or potentially JavaScript

Although it may seem like a basic question, I have never encountered this particular task before. My designer is requesting something similar to this design for checkboxes (positioned on the left side with grey for checked boxes and white for unchecked). ...

Malfunctioning Line in Apple Safari Causing ReactJS Issues

I am encountering an issue with my <div className={`${classes.center} ${classes.or}`}>OR</div>. It appears that this problem is specific to Apple Safari only. The alignment on the right side seems to be broken, although it works fine on Google ...

The view of the Google map is filled with numerous rounded tiles

Map divided into 3x3 tiles I am looking to customize the appearance of my map and remove all spaces and rounded corners to create a seamless, undivided visual. Is there a way to modify a map tile attribute to achieve this effect? Below is the code snippet ...

Nested CSS selector within a parent element

How can I change the color of both elements inside a custom button when the button is active? The first color is defined by the class of the button, and the second color is defined by the class of the span inside that button. CSS: .buttonClass{ color:b ...

If the width is below 767, the previous code will not be effective in jQuery

Challenge: How can I ensure that the code within the if statement only executes when the screen width exceeds 767px, and does not work if it is less than 767px? Using jQuery: $(document).ready(function() { $(window).resize(function() { if ($( ...

Switching between a secondary menu using ClassieJS or jQuery?

Currently, the code is configured to toggle the same menu for every icon. To see my current progress, you can check out this fiddle: http://jsfiddle.net/2Lyttauv/ My goal is to have a unique menu for each individual icon. I began by creating the followi ...

Steps to create a hover effect that alters the appearance of another chosen "element"

For instance, I have two classes named A and B. I want to be able to change the appearance of B when I hover over it, such as its color or size. I am unsure if this can be achieved using CSS and the onmouseover event. I am including a snippet of code that ...

Unusual sidebar scrolling issues experienced in Firefox

Currently, I am in the process of developing an app with a scrolling sidebar. However, there seems to be some unexpected behavior when using Firefox: the content within the sidebar disappears partially below the top of the div if the mouse is positioned lo ...

Setting a const value (true or false) based on the size of the window - a step-by-step guide

While studying, I encountered a challenge: In the code below, I need to dynamically set useState(false) based on the screen size. If the screen is larger than 947px, for instance, it should automatically be changed to true. The issue arises because sett ...

Emphasizing Text Within Div Element

Imagine having a div element structured as such: <div id="test" class="sourcecode"> "Some String" </div> Can CSS and JavaScript be utilized to highlight a specific portion of that string based on a search query? For instance, if the search q ...

When using CSS @media print with inches, different dimensions are displayed post-printing

I'm currently working on a project that involves printing a single div from my webpage. However, I've encountered some issues with the @page tag not affecting the print output as expected. I attempted to manually set the dimensions of the element ...

What is the most effective way to create a live preview using AngularJS and CSS?

Is there a way to dynamically change the background color of the body based on the hexadecimal value entered in a textfield, without using jQuery? I want the change to happen live as the user types. The current code works but it doesn't feel right. I ...

How to Transform a Navigation Bar into a Carousel

I am creating a website that is designed to be responsive. Currently, I have a horizontal navigation bar which collapses into a drop-down menu when the screen size decreases. When each tag in the menu is clicked, a different image loads into a designated ...

Struggling to get the AJAX code functioning correctly

Embarking on my journey with AJAX, I decided to test a simple example from the Microsoft 70515 book. Surprisingly, the code doesn't seem to be functioning as expected and I'm at a loss trying to figure out why - everything appears to be in order. ...

Issue with DIV height in Internet Explorer occurs only when application is accessed using server name

Encountering a unique issue specific to IE (confirmed in v8 and v9). When utilizing jquery to determine the height of a div: $('#sys_MainPage').height() In Chrome, Firefox, and when accessing using the IP address, this code returns around 26 ...

Defining the active element in the menu using JavaScript

I need help with my navigation menu: <ul> <li id="active"><a href="/">Home</a></li> <li><a href="/about/">About Us</a></li> <li><a href="/services/">Our Services</a>< ...