Bootstrap table with responsive design does not properly handle horizontal overflow

In my project, I attempted to customize a bootstrap table but encountered an issue when viewing the table on mobile devices. The 'table' always extends its width to fit 100% of the content within it. What I aim to achieve is for the table to have horizontal overflow-x when displayed on smaller screens https://i.sstatic.net/rsBeE.png

  <div class="my-table table-responsive">
    <table class="table my-dark-tb" style="overflow: hidden;">
      <thead class="my-thead-dark">
        <tr>
          <th scope="col">#</th>
          <th scope="col">First Data</th>
          <th scope="col">Second Data</th>
          <th scope="col">Address</th>
          <th scope="col">Phone</th>
          <th scope="col">Action</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row">1</th>
          <td> Lorem ipsum dolor sit amet consectetur. </td>
          <td>Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis consectetur autem quis.</td>
          <td>London</td>
          <td>981638027901</td>
          <td class="my-table-action">
            <a href="#view" class="action-button view">
              <span>Detail</span>
            </a>
            <a href="#edit" class="action-button edit">
              <span>Edit</span>
            </a>
            <a href="#delete" class="action-button delete" data-toggle="modal" data-target="#delete">
              <span>Delete</span>
            </a>
          </td>
        </tr>
        <tr>
          <th scope="row">2</th>
          <td>The quick, brown fox jumps over a lazy dog</td>
          <td>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog</td>
          <td>Tokyo</td>
          <td>62926281012</td>
          <td class="my-table-action">
            <a href="#view" class="action-button view">
              <span>Detail</span>
            </a>
            <a href="#edit" class="action-button edit">
              <span>Edit</span>
            </a>
            <a href="#delete" class="action-button delete" data-toggle="modal" data-target="#delete">
              <span>Delete</span>
            </a>
          </td>
        </tr>
        <tr>
          <th scope="row">3</th>
          <td>Far far away, behind the word mountains</td>
          <td>far from the countries Vokalia and Consonantia,</td>
          <td>Berlin</td>
          <td>1214123145112</td>
          <td class="my-table-action">
            <a href="#view" class="action-button view">
              <span>Detail</span>
            </a>
            <a href="#edit" class="action-button edit">
              <span>Edit</span>
            </a>
            <a href="#delete" class="action-button delete" data-toggle="modal" data-target="#delete">
              <span>Delete</span>
            </a>
          </td>
        </tr>
      </tbody>
    </table>
  </div>

The current setup works well until the screen width reaches 576px https://i.sstatic.net/kYAK8.png.

However, below 576px, the table occupies 100% of the page horizontally instead of implementing overflow-x functionality https://i.sstatic.net/N6yHz.png

This could be problematic when dealing with large amounts of data in the table.

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

Do the last block in the table occupy the remaining space in the row?

Trying to create an HTML email calendar and struggling with getting the last td to fill the remaining space without affecting the width of other rows. Is there a way to increase the width of just the 4th block on the last row to fill the empty space? Here ...

Incorporate External Web Page Information by Clicking a Button

Apologies if this question has already been asked, but despite my efforts to explore the available resources, I have not found a solution to my issue. I currently have an input field where users can enter their website, keyword, or industry. When they cli ...

What are some ways I can customize the appearance of a canvas element?

After discovering a canvas animation, I decided to customize it for my own needs. However, due to the fact that a canvas and its shapes are not DOM elements, I am struggling to style it properly. You can view my current progress here. When you hover over ...

Is there a way for me to position my chat messages on the right side in the chat room?

I have a react chat application and I'm looking to customize the appearance of my messages. Currently, all entries with an orange vertical bar belong to me and are displayed on the left side of the chat room. I would like to move them to the right sid ...

Deactivate toggle effect by clicking on a different link

My existing JavaScript code changes the background color of a link when it is clicked: $(".button").click(function(){ $(this).css('background-color', '#555'); }); While this functionality works, I am looking to have the color tog ...

Python code displays output directly on an HTML webpage

I have created a basic Python chatbot that performs calculations and responds to user input. The chatbot continuously runs in Python, checking previous responses for context. I want to make this chatbot available online and achieve the following: Send us ...

Guide to showing specific images alongside text through Ajax and Jquery

Currently, I am faced with the challenge of displaying specific text files using jQuery and Ajax. My goal is to have a text file appear based on the image being displayed. For instance, if an image of an apple is being shown, I would like the text below i ...

Utilizing JQuery to create a dynamic background image slider that cycles through images extracted from a selection of

Case Study: Implementing a background-image slider with JQuery listening for window resizing. Depending on the screen size, a specific array is set as the image file paths source. Encountering a 6-second delay issue where the initial image does not displ ...

The table refuses to load

I've been troubleshooting this issue for the past two days. The array is visible in the console, but it refuses to show up on the table. I've tried multiple approaches, but none seem to work. I suspect that "tobodyHtml" is not defined properly, a ...

Unable to activate dropdown menu in html and css

Hi there, I'm facing an issue with hiding the dropdown-menu submenu. I tried using display: block !important;, but it didn't work. Even when I used display: none !important;, the dropdown menu still wouldn't disappear. I want the dropdown s ...

Issue with Angular ngFor not updating radio button value when ngModel is set

Hello, I am fairly new to working with Angular and could really use some assistance with a problem I've run into. Essentially, I am receiving an array of objects from an API like this: [{name: "abc", score: 2},{name: ""def, score: ...

"Resolving the duplication issue of a textbox in Phonegap app

I encountered a strange issue recently. While trying to focus on the textbox in my PhoneGap application using touch, I noticed that there are actually 2 textboxes appearing. Please refer to the attached image: ...

How can you retrieve information from your ThingSpeak channel by utilizing a toggle button in jQuery?

I have implemented a code that successfully switches on and off. Now I am looking to incorporate reading data from my thingspeak channel based on the values 1 and 0, using the read channel URL. However, I am facing challenges in writing this functionalit ...

What solutions are there for resolving the error "Cannot read property 'style' of null" in JavaScript?

My function is designed to update the progress bar based on the document's loaded value. However, for some reason, it seems that this specific element is unable to render. Despite my efforts, I cannot figure out why other div elements can be identifie ...

View 360-degree panoramas on an iPad using the krpano HTML

I am currently experimenting with the KRPano HTML5 panorama viewer for a specific page on tablets/iPads. The flash viewer works seamlessly on desktops: embedpano({ swf: "/Files/Flash/krpano.swf", xml: "/Files/Flash/view.xml", target: "panview", id: "krpan ...

Monitor File Tool for JetBrains IDE - CSS Optimization Setup - Streamline CSS Automatically

Utilizing the File Watcher tool in Jetbrains IDE (Webstorm and Rider) to automatically minify .css files and generate corresponding .min.css files for the entire project has been my goal. However, a challenge arises when it starts minifying files that alr ...

Combining header and data elements within the same row by using the set_template function in the CodeIgniter

Utilizing the HTML Table Class from CodeIgniter, I am working on creating a table template. The example provided in the documentation is as follows: $tmpl = array ( 'table_open' => '<table border="0" cellpaddi ...

Setting default selections for mat-select component in Angular 6

I've been attempting to preselect multiple options in a mat-select element, but I haven't been successful so far. Below is the snippet of HTML code: <mat-dialog-content [formGroup]="form"> <mat-form-field> <mat-select pla ...

Display loading spinner and lock the page while a request is being processed via AJAX

Currently, I am working on a project using MVC in C#, along with Bootstrap and FontAwesome. The main objective of my project is to display a spinner and disable the page while waiting for an ajax request. Up until now, I have been able to achieve this go ...

Hide the border below the active tab

Could anyone assist me in removing the border below the selected tab? I've attempted multiple approaches without success. I experimented with adding a negative margin to the tab and creating a white border, but as the border I want to conceal is from ...