Tablet does not retain color on cells with overflow

I am experiencing an issue with the table, which can be seen in this image :

https://i.sstatic.net/QMEsv.png

Each row in the table has a color (all green in this case), but cells with overflow (scroll) seem to have trouble maintaining the cell's color. A peculiar observation is that the colors appear below the table (near the "Légende" button).

Below is a snippet of my CSS:

table {
    table-layout: fixed;
    width: 100%;
}

table tr td{
    overflow: scroll;
    overflow-y: hidden;
    overflow-x: auto;
    white-space: nowrap;
}

td::-webkit-scrollbar-thumb {
    -webkit-border-radius: 2px;
    -webkit-box-shadow: inset 0 0 2px rgba(0,0,0,0.5);
    background: transparent;
}

td::-webkit-scrollbar-thumb:window-inactive {
    background: rgba(255,255,255,0.3);
}

td::-webkit-scrollbar-track {
    background: transparent;
    border: 0;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #838383;
}

::-webkit-scrollbar-thumb:active {
    background: #6a6a6a;
}

tr {
    background-color: rgb(xx, xx, xx);
    display: tabl-row;
}

I'm unsure if this issue is due to my CSS or if it's a bug specific to smaller screens like tablets when using Chrome. The problem does not occur on a laptop screen with the same browser.

Answer №1

Applying overflow scroll directly to the td tag is not possible. To achieve this, you need to nest a block-level div with the overflow:scroll property set inside the td tag. Here's an example:

<td><div style="overflow:scroll;">Content</div></td>

If you encounter a similar issue, you can find solutions on this Stack Overflow thread.

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 could be causing the DIV elements in this React Bootstrap list to not be centered?

I'm currently working on creating an image gallery using react-boostrap. Everything is scaling properly when I resize the page, but the images are still aligned to the left. Is there a way to center them instead? <div class="container-fluid&qu ...

What is the best way to choose a table row <tr> along with the one directly before it?

In the table I have, the first column spans over two rows while the following columns are split into two separate rows. For this table, I need multiple instances of these "doubled rows", which is not a problem so far. To style it with a zebra pattern, I ...

Solving the challenge of HTML checkbox design

I have successfully styled checkboxes with a background color, but now I want each checkbox to have a different color without having to rewrite a lot of code for each one. Check out the demo here .checkbox { display: inline-block; cursor: point ...

"Aligning Images and Text in Sencha Touch Proves to be Ch

Exploring Sencha Touch for the first time and running into challenges with styling images (such as centering) and text (like adjusting size/color). Can anyone guide me on where to add style tags? Sample item below: // The following represents a simple ...

How can you adjust the width of the Material UI Select component?

Trying to customize the width of the Material UI Select component can be a bit tricky. To set the desired width, you need to assign a specific class to the FormControl component. This class, such as mw-120, should define the minimum width as 120px in your ...

Issue with the button border not functioning correctly upon hover

I'm currently practicing my HTML and CSS skills, with a focus on creating buttons. I have encountered an issue where I want a colored border to appear around the button when hovered over. Unfortunately, I seem to be stuck and unable to achieve the des ...

What is the process for obtaining X through the use of createElement('img')?

Is there a way to retrieve the X position from the left of the tag created using document.createElement('img'); var block00 = document.createElement("img"); block00.src = "images/sep1.png"; If so, how can it be done: if (block00.getBoundingCli ...

Creating a perfectly centered square canvas on your screen

In the game I'm developing, I need to position a canvas at the center of the screen. The canvas should have equal width and height, covering the entire screen without overflowing, essentially creating a square shape. Is there a way to achieve this us ...

Eliminate the margin on the subnavigation menu

Hey there, I'm looking to adjust the layout of my menu buttons by removing the left and right "margins" (if that's the correct term), so they all fit neatly inside the navigation bar. https://i.sstatic.net/udes8.png I want to ensure that all th ...

The Bootstrap dropdown is causing a paragraph to have an overflow issue

When my paragraph text contains too many words, it tends to overlap. Take a look at the code snippet below: <a class="dropdown-item content btnOpen"> <div class="col-sm-12"> <div class="row"> <div class="col-md-2 p-1"> ...

"Render Failure" JavaScript and CSS files

I'm encountering a peculiar issue while attempting to load certain JS and CSS files. Within my ASP.NET MVC Web Project, I have an Index.html file where I've specified the loading of script files. It's worth noting that I have modified the U ...

How to Align Two Headers Vertically Next to Each Other Using HTML and CSS

Looking for a solution for aligning the orange date: Here is the current setup: Check out the JsFiddle example: http://jsfiddle.net/N4gpA/ (Including code as jsfiddle-only is not permitted) HTML: <div class="Box1"><a href="#"&g ...

Tips for altering the color of input text in CSS with the inclusion of the Bootstrap framework

I'm having trouble changing the color of input text to black in Bootstrap. <input type="text" id="name" name="nomclient" style="background-color: white;" style="color: black;" /> ...

Save a CSS class within the browser

One feature of my project is the ability to change the site theme with a simple click: <ul> <li class="=contact"><a href="#">Contact</a></li> <li class="facebook"><a href="#">Facebook</a></li> &l ...

AngularJS - enable user authentication to access exclusive content on the webpage without redirecting to a new page

I'm struggling with implementing a login form on my AngularJS site... My goal is to dynamically load a login form onto any page of the site without needing to navigate away, then asynchronously handle user login information and display a success or f ...

adjusting label widths using jQuery mobile

I am currently using jQuery mobile to develop my user interface, however I am facing an issue with adjusting the width of my labels. Can anyone provide guidance on how to set the width of all my labels to 108px? http://jsfiddle.net/GZaqz/ Check out the c ...

Enhancing the mouse pointer in a JAVA application

Currently, I am immersed in a school project and trying to capture the attention of children by implementing a unique feature - a special mouse pointer. Imagine a pointer that moves, causing a small bird to follow its every movement. My project is based ...

Tips for Aligning Pagination at the Center in jQuery Bootstrap DataTables Extension

I am currently utilizing jQuery's DataTables plugin in conjunction with Bootstrap 3.1 to facilitate sorting and paginating server-side content. This is the current appearance of my table: http://datatables.net/manual/styling/bootstrap-simple.html W ...

Jssor's dynamic slider brings a touch of sophistication to preview upcoming images

Incorporating the jssor nearby slider to create a nearly fullscreen display. The goal is to set the opacity of upcoming images to 0.25 when they are not in the main viewport, giving the edges of the upcoming and previous slides a slight transparency. < ...

Testing the fallback of a fontawesome stylesheet in ASP.Net Core using CDN

Which class should be used to test the fallback of the fontawesome css stylesheet in ASP.net Core 2.2 Tag helper? I've implemented this, but when I check using F12 Developer Options Network in Chrome, it shows that both the cdnjs and local library ar ...