The size of the table and the ability to scroll cannot be adjusted

<div id="answer3" class="tab-pane">  
          <div class="col-md-12" style="background-color:rgba(68, 70, 79,0.4);padding-left:50px;padding-top:5px;border-radius:5px;height:100%;">
              <h3>KEYBOARD SHORTCUT INFO</h3></br>
              <div class="container" ng-app="sortApp" ng-controller="mainController">
                  <form>
                      <div class="form-group">
                          <div class="input-group">
                              <div style="color:white;background-color:#f78800;border-color:#f78800;" class="input-group-addon"><i class="fa fa-search"></i></div>
                                  <input style="width:97%;"type="text" class="form-control" placeholder="Search..." ng-model="searchFish">
                          </div>      
                      </div>
                  </form;

              <table class="table table-bordered" id="hotkey">
                <thead>
                    <tr>
                        <td>
                            <a style="color:#f78800;font-weight:bold;font-size:15px;">KEY</a>
                        </td>
                        <td>
                            <a style="color:#f78800;font-weight:bold;font-size:15px;">ON FOOT</a>
                        </td>
                        <td>
                            <a style="color:#f78800;font-weight:bold;font-size:15px;">IN VEHICLE</a>
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="roll in sushi | orderBy:sortType:sortReverse | filter:searchFish">
                        <td>{{ roll.name }}</td>
                        <td>{{ roll.fish }}</td>
                       <td>{{ roll.tastiness }}</td>
                    </tr>
                </tbody>

            </table>
          </div>
        </div>
      </div>
#hotkey {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 97%;
overflow-y: scroll;
max-height: 300px;
}

#hotkey td, #hotkey th {
border: 2px solid #f78800;
padding: 8px;
}

#hotkey td {
padding-top: 12px;
padding-bottom: 12px;
text-align: center;
color: #fff;
background-color:transparent;
}
angular.module('sortApp', [])

.controller('mainController', function($scope) {
$scope.sortType     = 'name'; // set the default sort type
$scope.sortReverse  = false;  // set the default sort order
$scope.searchFish   = '';     // set the default search/filter term

// create the list of keyboard shortcuts 
$scope.sushi = [
{ name: '` / ~', fish: 'PLAYER INFO - SERVER RULES - KEYBOARD SHORTCUT', tastiness: '-' },
{ name: 'F1', fish: 'PLAYER INTERACTION', tastiness: 'VEHICLE INTERACTION' },
{ name: 'F2', fish: 'INVENTORY', tastiness: '-' },
{ name: 'F3', fish: '-', tastiness: 'INVENTORY' },
{ name: 'F4', fish: '', tastiness: '' },
{ name: 'F4', fish: 'EMOTES', tastiness: '-' },
{ name: 'F6', fish: 'JOB INTERACTION', tastiness: '-' },
{ name: 'F7', fish: 'SCOREBOARD', tastiness: 'SCOREBOARD' },
{ name: 'F8', fish: 'CONSOLE LOG', tastiness: 'CONSOLE LOG' },
{ name: 'F12', fish: 'SCREENSHOT', tastiness: 'SCREENSHOT' },
{ name: 'E', fish: '-', tastiness: 'HORN' },
{ name: 'T', fish: 'CHAT', tastiness: 'CHAT' },
{ name: 'Y', fish: '-', tastiness: 'CRUISE CONTROL' },
{ name: 'U', fish: '-', tastiness: 'SPEED LOCK' },
{ name: 'H', fish: '-', tastiness: 'VEHICLE LIGHTS' },
{ name: 'K', fish: 'HELMET/GLASSES/MASK', tastiness: 'HELMET/GLASSES/MASK' },
{ name: 'BACKSPACE', fish: '-', tastiness: 'HAZARD' },
{ name: '-', fish: '-', tastiness: 'LEFT SIGNAL' },
{ name: '=', fish: '-', tastiness: 'RIGHT SIGNAL' },
{ name: 'B', fish: '-', tastiness: 'SEATBELT' }
];

});

Hello! I am looking to address a problem where if the height of the table exceeds 300px, I want the table to have a scrollbar. I attempted using overflow:scroll; but it didn't work as expected. I'm unsure about where and how to apply the overflow property along with setting the height to 300px. Despite my efforts, the table still extends beyond the body. Any suggestions on how to resolve this issue would be greatly appreciated. Thank you!

Answer №1

RESOLVED Implementing height and overflow properties in container div style

<div class="container" ng-app="sortApp" ng-controller="mainController" style='height:580px;overflow-y:scroll;'>

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 best way to customize the appearance of a non-current month cell within the date picker?

I'm currently in the process of developing a registration form for my JavaFX application. I am faced with an issue where I need to disable certain cells in the date picker when they do not belong to the displayed month. Let's take a look at my cu ...

In PHP, echo only a single item from the array when the page loads, and refrain from echoing if the

With PHP, I have an array of values. Is it possible to echo a value when a user first reloads the page, but not output the same value if the page is reloaded again? foreach($_SESSION['arrayFolders'] as $value){ if (in_array($_SESSION['ar ...

mismatch between margin-left and auto not aligning

Having trouble with margin-left: auto not working 1- Looking to create a header with an image and a navbar 2- Want two unordered lists in the navbar 3- Trying to position one list on the left side and the second on the right side When I use margin-left: 8 ...

What methods are recommended for expanding the size of a select/dropdown menu?

Managing a long list of values can be challenging, especially when it continues to grow. Consider the following example: <select> <option value="1">1, some test</option> <option value="2">2, some text</option> <optio ...

Unable to display information from a repeated `textarea` in ngRepeat

Check out my code on Plunker: https://plnkr.co/edit/rBGQyOpi9lS0QtnCUq4L I'm trying to log the content of each textarea when typing, using the printStuff() function: $scope.printStuff = function(customize, item) { console.log(customize[item.inde ...

The currency exchange script is malfunctioning and not functioning properly

Is there a solution for accessing the JSON value that is currently eluding me? If anyone has any suggestions, I would greatly appreciate it. function forex() { var to = document.getElementById("to").value; alert(to); var from = document.getE ...

The Bootstrap Modal consistently shows the contents of the first record when used within a SQL While Statement

As a newcomer, I am in the process of converting an operational Bootstrap modal that houses a post form. Initially, the modal would open using a button with a specific Id and would always display the FORM contents from the first record found in the SQL w ...

The indispensable field in my HTML form is failing to function

I have structured an HTML form with necessary fields and a Submit button triggering a function called add() on click. The HTML code snippet is as follows: Enter name: <div class="mb-3& ...

Emphasize a div container within a content-editable field as though it were regular text

I currently have a unique JS Fiddle demonstrating a div with a background image inside a content editable input. My goal is to highlight the div as if it were regular text. .input { border: 1px solid black; width: 200px; } .emoji { width: 16px; ...

Numerous asynchronous AJAX requests accompanied by various loading indicators

My ASP.net MVC page is utilizing ajax calls to load data for each of the six divs. To handle the loading indicator, I have created two methods as shown below. $("#divId").loading(); $("#divId").stopLoading(); Here is an example of one of my ajax calls ( ...

The issue with the $(window).width() property not functioning correctly in Internet Explorer

Currently, I have a Div element with absolute positioning: <div id="target" style="height: 300px; position: absolute; top: 275px;"></div> My goal is to calculate the horizontal resolution of the screen using JavaScript. With this width, I the ...

I prefer the jumbotron to be uninterrupted by the navbar

I'm facing an issue where my jumbotron is ending up under the navbar, but I want to position it just below with some padding in between. Here's the code snippet: Take a look at the current appearance here: This is how it looks like ...

What is the best way to attach event handlers to dynamically generated buttons using jQuery?

While utilizing AJAX to dynamically generate HTML, an issue has arisen. <script> function page_loaded(){ jQuery.ajax({ method: "GET", url: "get_data_dashboard.php", success: function(data){ ...

Is it possible to generate an HTML file without MathML by rendering MathJax/MathML at compilation/preprocessing time?

I am looking for a solution to convert webpages with heavy MathJax (or MathML) usage into ebooks for display on my Kindle, which does not fully support JavaScript or MathML. I am interested in preprocessing the .html files by running MathJax during a com ...

Creating a user-friendly HTML form to convert multiple objects into JSON format

Edited content: $.fn.serializeObject = function() { var obj = {}; var arr = this.serializeArray(); $.each(arr, function() { var value = this.value || ''; if (/^\d+$/.test(value)) value = +value; if (obj[this.name] !== u ...

Alter the color scheme of Fancybox's background

I am looking to create a transparent background color for Fancybox. The typical method involves using ".fancybox-skin" in CSS, however this will affect all fancyboxes and I require it to be unique. Therefore, the setting must be sent with wrapCSS. Fancyb ...

Create CSS styles that are responsive to different screen sizes and

What is the best approach to ensure that these styles are responsive on any mobile device? nav ul ul { display: none; } nav ul li:hover > ul { display: block; } nav ul { background: #0066cc; background: linear-gradient(top, #0066cc 0%, #bbbbbb 10 ...

What are the best practices for creating a contemporary website that functions effectively on IE7?

After creating several websites for my clients, I discovered that they are not functioning well in IE7. Unfortunately, there is still a small percentage of people using IE7. Can anyone suggest a super quick solution to fix this issue? Feel free to recomm ...

Form featuring a mandatory checkbox that must be selected in order to proceed; failure to do so will result in an

So here’s the situation: I have a form with a checkbox for agreeing to the terms of service, and I want to make sure it is checked before proceeding with the donation process. I only have the HTML code and no idea how to implement this functionality. Ide ...

Creating a seamless full-page grid layout with CSS to eliminate the need for scrolling

My goal is to have 20 items on the grid of this page, each taking up full width and height with a fluid layout. Currently, I have successfully set up the page with 20 items spanning full width in a fluid design. However, the content of the grid is being p ...