The dynamic table is too large for the bootstrap card

My issue involves datatables within bootstrap cards. When the table exceeds the height of the card, it extends outside the boundaries. Even with overflow: auto on a table-wrapper in place, the scroll does not trigger when exceeding the card's height.

For a clearer picture, here's a simplified example: https://stackblitz.com/edit/js-bootstrap4-gbnhfx?file=style.css

Answer №1

I have created a fork of your stackblitz project (https://stackblitz.com/edit/js-bootstrap4-tsnbuq)

To keep things simple, I have used a style attribute in this code snippet. The inner div is the element that is overflowing, and the outer div (where CSS for overflow handling is applied) adds the scroll.

Take a look at the main change below:

<div class="table-wrap">
  <div style="height:690px">
    <table class="table table-sm table-dark table-striped">
      <thead>
      </thead>
      <tbody>
          <tr>
              <td>test</td>
          </tr>
      </tbody>
    </table>
  </div>
</div>

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

Unable to display keyboard on HTML input form in webview

Can someone assist me with displaying and allowing the keyboard to show and input properly? In my simple app, I have a main screen with buttons. When a button is clicked, it opens a webview. One of the buttons opens a webview to an HTML page with an input ...

Stylesheets are failing to load due to a conditional statement issue

For the first time in a long while, I found myself resorting to conditional statements to fix compatibility issues in IE. My dilemma lies in trying to implement separate stylesheets for IE and other browsers such as FF. Despite my efforts, neither messag ...

Ways to shorten a card

Below is a snippet of code that I have been working on. <div class="thim-course-grid"> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <div class="lpr_course <?php echo ' ...

What is the best method for efficiently wrapping contents within a div container?

On the website cjshayward.com/index_new.html, there is a div wrapped around the content of the body, which is approximately 1000 pixels wide. In Chrome and Firefox, the wrapper works perfectly for the top section of about 100 pixels. Further down the page, ...

Is scrollTo completely unresponsive?

As a developer specializing in Salesforce, I have successfully implemented a scroll feature that allows users to swipe up and down on all browsers and devices such as iPhone, iPad, and Android. However, when the same page is viewed in the Salesforce1 app, ...

Difficulties in Adjusting the Size of Three Image Columns within a Website's Body

While working on my website layout, I encountered a problem with inserting three image columns in the body section. The images turned out to be too large and extended beyond the footer. Moreover, the third image was larger than expected, dominating the web ...

Using ng-bind-html within a ng-repeat loop

Currently, I am working on developing a custom autosuggest feature where a web service is queried with a search term to retrieve a list of suggestions that are then displayed. My main obstacle lies in trying to highlight the matching term within the sugges ...

How to Handle the Absence of HTML5 Spellcheck in Specific Web Browsers

While HTML5 spellcheck functionality may vary across different browsers, there are instances where it might not be supported in certain corporate environments. In the event that HTML5 is not supported in a particular browser, it's essential to first c ...

Guide to showing Bootstrap Offcanvas within a Modal

Can the Offcanvas feature from Bootstrap be displayed within a Modal? Below is the code snippet: <script src="https://cdn.jsdelivr.net/npm/@popperjs/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ccafa3bea98cfee2f5e2fe" ...

How to align several lines of text in a table cell

I've been trying to center multiple lines of text in a table cell using the table method, but no matter how many online guides and SO posts I follow, I just can't seem to get it right. What I'm aiming for is to have the text perfectly cente ...

Creating a Faux Font-Icon Effect Using CSS and PNG

I am looking for a way to change the color of a transparent, grey-scale PNG icon as easily as changing the color of a font icon. More details: The PNG icons have both outer transparencies and inner white areas for the actual symbol, along with a slight gr ...

I would like to take the first two letters of the first and last name from the text box and display them somewhere on the page

Can anyone help me with creating a code that will display the first two letters of a person's first name followed by their last name in a text box? For example, if someone enters "Salman Shaikh," it should appear somewhere on my page as "SASH." I woul ...

Preventing background style from taking precedence over backgroundColor style in React's inline styling

What causes background to take precedence over backgroundColor in React inline-style? In this scenario, the lack of a specified green background-color results in the background gradient with transparency transitioning into white rather than green within t ...

In Firefox, right floated elements vanish when utilizing columns

Utilizing the ol element with column-count and column-gap properties to organize the list into 2 columns, each list item contains a span element floated right. However, I am encountering an issue where the span element is not displayed for certain items li ...

Is there a way to point my Github URL to the index file within a specific folder?

The actual working location of my website: My desired working location for the site: Originally, I had my index.html file in the main repository, but later moved it to an html folder along with other html files for better organization. How can I ensure t ...

Issues with Angular.js controller functionality

I am currently in the process of learning Angular and have been following the Intro to Angular videos provided on the official Angular website. However, I seem to be encountering an issue with my code that I can't quite figure out. The error message I ...

Including 'active' in an HTML button does not trigger the styles specified in the :active pseudo-class

When a button is clicked, I want its color to change. Below are the HTML elements in question: <div class='chatbot-container'> <div class='chatbot-wrapper' id='chatbot-wrapper' style="display:none;" & ...

If the td element contains text, add a comma (,) and wrap the text in HTML tags. If there

Currently diving into some jQuery code and have come across a few uncertainties. Here is what I've managed to put together so far: var html = ''; data.entities.forEach(function (value, index, array) { html += index !== data.entities.len ...

I must generate numerous copies of my CSS class using JavaScript

My CSS includes a base class named "toast" that contains basic styling, along with a JavaScript function that generates different types of toasts based on user input. The function modifies the toast class by inserting icons and text as demonstrated below: ...

Having difficulty selecting an element using XPath based on its title

https://i.stack.imgur.com/Of29v.png My XPath: ((//span[text()='Number of Allowances'])/../../../following::div//table[@class='mainTable']//tr[1]//input[@data-automation-id="numericInput"]) The XPath above clearly specifies that the ai ...