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

Adjust google maps to fill the entire vertical space available

I found this helpful resource for integrating Google Maps into my Ionic app. Everything is working smoothly, but I am trying to make the map fill the remaining height below the header. Currently, I can only set a fixed height in pixels like this: .angula ...

Adding a unique styling to a div with a custom css class

I am experiencing an issue with my CSS file (approval.css) that is defined as a resource and applied to my XPage. Within the css, there is a specific line of code: .appNavBackground {background-color:#ffffd6 ;} When I try to apply this styleClass to a di ...

Position a single div on the left-hand side and arrange two divs on the right using display:flex

Is there a way to achieve this layout without adding another div, using only parents and 3 child elements? I had tried using height: max-content, but it didn't work as expected. .container { display: flex; flex-wrap: wrap; } .item { flex-bas ...

I am curious if there is a method to vertically center text without being affected by the font-family or font-size

Searching for a font-independent method to center text within a div. My div has a button-style fixed height, and I need the text (one line only) to be centered vertically within it. The issue arises when changing the font-family, as some fonts do not ali ...

On smaller screens, the top placement of right sidebar links is necessary

Our website layout is organized into 3 main sections: the top part contains the main menu, followed by the main content and a sidebar specific to each page. The main content and sidebar are structured using bootstrap col-* classes. On small screens, I en ...

The CSS styles do not seem to be taking effect on the Bootstrap

Here's a snippet of code extracted from my website's html and css files. My intention is to make the navbar slightly transparent with centered links, but for some reason, the css styles are not applying correctly to the navbar. HTML <body ...

Dynamically Allocating Page Heights

I am tasked with creating an ASP.NET MVC page that will display a template of controls. The controls will be retrieved from an XML file. One issue I am facing is that the number of controls is not fixed, so the page height needs to be dynamic. Our site has ...

Deleting the clone <div> while ensuring the main <div> is kept clear of any remaining data

Initially: After adding a new row and then removing it. Why is this happening? When I set val(""), the textbox should have no value. What mistake did I make in my code? Please assist. Here's the code snippet: <div id="rows" class="block"> ...

What is the best way to reduce the distance between labels and input fields?

Currently, I am utilizing Blazorise along with Bootstrap 5, however, I have noticed that the spacing between the input field and the label is too wide. Here is an illustration of the space between the input and the label: Is there a way for me to reduce ...

Adding padding with and without child elements

As I work on styling a basic menu, I'm struggling to find a solution for adding padding to list items so they all have a consistent look. The challenge arises from the fact that I have an unordered list where list items may or may not contain an anch ...

What is the best way to use a computed property as a style value for a component in Vue.js?

My component's template includes the following HTML element: .grid-item(:style="{ width: columnWidth, backgroundColor: 'blue' }") I want to dynamically set the width of this element using a computed property: computed: { columnWidth () ...

Tips for aligning a row at the bottom within a nested column

Desired Outcome I am struggling to arrange two smaller images next to a larger image using Bootstrap 4. Specifically, I am having difficulty aligning one of the smaller images at the bottom so that it matches the alignment of the larger image. The layout ...

In Chrome, the computed style of background-position is returned as 0% 0%

Let's say I have an element and I am interested in finding out its background-position: To achieve this, I use the following code snippet: window.getComputedStyle(element).getPropertyValue('background-position') If the value of background ...

Centering the scroll bar with Flexbox

Is it possible to center the scroll bar of a flex box in the middle of the screen? Currently, when using the code below I am seeing the UI as shown below, with the scroll bar at the bottom of the container DIV https://i.sstatic.net/XakpC.png Instead, is ...

Are the JQuery appended elements exceeding the width of the parent div?

I have an HTML div that is styled using the Bootstrap class span9. <div class="span9"> <div id = "selectedtags" class="well"> </div> <button class="btn" type="button" id="delegatecontent">Generate report</button&g ...

Utilizing the Page Method to Handle Warnings in $.ajax({}) Calls

I created a custom method in the .cs file of my Default.aspx page: [WebMethod] public static string ConvertToJSON(object data) { JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); string json = jsSerializer.Serialize(data); retu ...

Text not aligning properly when utilizing the <p> tag

I'm struggling to align my text in a row, as shown below: https://i.sstatic.net/SGQ8I.png "Investup" and "Real estate" should be aligned. I need to move the "Real estate" paragraph so that it aligns with the "invest up" paragraph. Here's my co ...

Eliminate the need for pressing the "tab" key on my website

I'm currently working on a horizontal web page layout and I'm looking for a way to disable the "tab" button functionality on my page. The issue arises because I have a contact form with textboxes located in the last div, and when users navigate u ...

Guide on implementing a scroll feature for a div element with a fixed width that contains a dynamically generated table with td elements of fixed width in HTML

Struggling with HTML formatting. I'm facing an issue where I have a table nested inside a div. The div has a fixed width of 200px and the td elements are added dynamically. Despite setting each td to be 100px wide, when five td elements are added, to ...

Creating an XML file using C#

I am trying to work with a DataTable that looks like this: DataTable dt = new DataTable(); dt.Columns.Add("region", typeof(string)); dt.Columns.Add("technology", typeof(string)); dt.Columns.Add("sitetype", typeof(string)); dt.Columns.Add("status", typeof( ...