Issue with table border appearing incorrectly on Chrome browser - **Verified Bug**

Encountering an unusual issue that seems to be specific to Chrome, which is out of the ordinary. I have meticulously recreated the problem in the following plunkr.

http://plnkr.co/edit/k0viyc

To demonstrate the issue, you can see how the border appears in the highlighted row in Chrome but not in IE.

If either of the following rows are removed:

<tr class="spacer">
  <td colspan="14" class="noBorder noBackground">
    *** By removing this row, the extended border goes away ***
  </td>
</tr>

You will notice the corresponding border appearing/disappearing.

We have conducted numerous tests and experiments to identify the root cause without success. The primary css remains intact in the plunkr, including inline styles and classes that are mainly linked to bindings.

I am seeking input on whether there is a flaw in the current design or if this is truly a bug in Chrome. If it's indeed a bug, what elements are necessary to replicate it? Should we report it as a bug, or is it something we should simply try to avoid?

Thank you for your time in advance.

Answer №1

Seems like we've stumbled upon a bug in Chrome.

I've put together a simple example that showcases the issue:

.test {
  border-collapse: collapse;
}

td {
  border: solid 1px blue;
}

.no {
  border: none;
}
<table class="test">
<tr>
<td>one</td>
<td class="no">two</td>
</tr>
<tr>
<td class="no" colspan="2">double</td>
</tr>
</table>

This issue seems to be related to border rendering bug in Chromium.

The explanation from the Chromium team is somewhat concerning:

It's a known (old) issue in our table code. Collapsing borders are determined based on adjacent cells and our code doesn't deal correctly with spanning cells (we only consider the cell adjoining the first row / column in a row / column span). On top of that, our border granularity is determined by the cell's span.

To fix this bug, we would need to overhaul our collapsing border code, which is a big undertaking.

In summary:

If the table has border-collapse

and the cell spans multiple columns (colspaning)

Then different border settings for that cell will not work as expected.

Possible solutions could include:

Setting border-style to hidden for the cell to hide all borders (not ideal)

Removing colspan in the spacer rows

or perhaps eliminating the spacer rows entirely and displaying the content differently.

Answer №2

There appears to be a glitch involving the tr.spacer.

To temporarily fix this issue, add colspan=7 to the td within the tr.spacer.

Answer №3

Encountering an issue with Chrome, it appears to be a bug with using colspan. Instead of relying on colspan, consider adding the necessary cells individually to avoid any border-related classes.

For example:

<tr><td class="border">1</td><td class="border">2</td><td class="no-border">3</td></tr>
<tr><td colspan="3" class="no-border">&nbsp;</td></tr>

Can be adjusted as follows:

<tr><td class="border">1</td><td class="border">2</td><td class="no-border">3</td></tr>
<tr><td colspan="2" class="no-border">&nbsp</td><td class="no-border">&nbsp;</td></tr>

If you are also experiencing difficulties with border-collapse, this alteration in the HTML structure could provide a solution.

Answer №4

After spending days pondering this problem, I finally came up with a creative solution. Simply set the border color to match your background color.

td {
  border: 1px solid (background color);
}

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

Creating a unique chrome extension that swaps out HTML and JavaScript components

Is there a possibility to create a Chrome extension that eliminates the JavaScript and CSS from a website while it loads, replacing them with new scripts from a separate source? For example, changing 'Old script' to 'new script', or &a ...

Tips for positioning a div element at the center of another div while ensuring it remains responsive and stays within the center

Is it possible to stack a small div on top of another div and have the small div centered at the bottom? I want the layout to look like this: Style. I've looked up solutions, but some suggest making the small div relative, which causes it not to stac ...

Align a button within an input field to be in line with a stacked label in

I'm currently facing some issues with Ionic because it's not placing my button where I want it to be: https://i.stack.imgur.com/qtUQJ.png My goal is to have the button on the same line as the input, similar to the clear-button. This is the cod ...

Access an HTML webpage using a PHP function

Recently, I delved into learning PHP and a question popped up in my mind: I have this PHP file that consists of a function named `sqlConnect();` This function checks if the user is already logged into the MySQL DB. If not, it redirects the user to an HT ...

What is the best way to center text within a content wrapper?

HTML <div class="container--wrap"> <div id="rtitle"> <p id="ptitle" style="color: #D8DCE6; font-size: 30px; text-align: center; padding-top: 15px; font-weight: bolder; margin-bottom: 0;">INFO <span id="f ...

Tips for centering content vertically in a column using Bootstrap 4

Working on a Bootstrap 4 grid layout, my goal is to vertically align content within a column while maintaining its full height. Here is my current layout for reference: https://i.sstatic.net/6RWx3.png I am aiming for the content alignment to look like th ...

Begin jQuery animation promptly without any easing

When utilizing the given Jquery example in Chrome, the easing effect during the mouseenter event causes a brief pause in the animation. Is there a way to trigger the animation to start immediately? The intended outcome is for the animation to shift move c ...

Is there a method to trigger the opening of a calendar downwards within a modal?

I am having an issue with a p-dialog that contains a p-calendar. The problem is that when I try to open the calendar, it pops up upwards instead of downwards. <p-dialog responsive="true" modal="true" (onHide)="closeDialog()" #genericDialog [(visi ...

CSS implementation of a treeview with a dropdown submenu

I'm currently customizing an HTML tree view using CSS, and my goal is to have sublists smoothly slide down whenever a node is expanded. Take a look at my streamlined index.html : <!DOCTYPE html> <html> <head> <script data ...

The issue of the drop-down menu not appearing persists when using HTML and CSS

ul#menu li ,ul.sub-menu li { list-style-type: none; float:left; } ul#menu li a ,ul.sub-menu li a { display: inline-block; width: 150px; height: 40px; text-decoration: none; line-height: 40px; text-align: center; color:rgb(235, 139, 13) ...

Efficiently Displaying Multiple HTML Elements in React Native WebView

I am currently working on developing an Epub reader in React Native and facing a challenge. I need to find a way to efficiently transfer multiple html content files from the Epub container to the webview in order to achieve seamless pagination. ...

The Jquery AJAX request is failing to run

Looking for some help with my sign-up page project. I have the current version hosted here: I'm using bootstrapValidator and it's been working well so far. The issue arises after the validation process upon clicking the button - I want the submi ...

What is the best way to switch a single class using jQuery without impacting other elements with the same class

I'm in the process of implementing a commenting system similar to Reddit on my website. Each comment is equipped with a small button in the top right corner that allows users to collapse the comment. To achieve the collapsing effect, I am utilizing j ...

Using DOMParser() eliminates whitespace

Basic code example: const parser = new DOMParser(); const foo = parser.parseFromString(<p> Foo</p>, 'text/html'); console.log(foo); This results in https://i.sstatic.net/8E2br.png Why have all the leading empty spaces before " ...

Trouble Encountered When Retrieving innerHTML Content Using JavaScript

The code snippet provided below showcases how I am able to extract the innerHTML text from an HTML element. if(a.tagName){ if("option"==a.tagName.toLowerCase()) return a.text.replace(/\u00A0/g," "); if("select-one"==a.type||"select-multiple"==a.t ...

Tips on incorporating the $ symbol into a pseudo element

Can I add a price using a pseudo element? h3:after{ content: " (+ $75)"; } <h3>price</h3> The CSS minifier is preventing the display of "$75". How can I work around this issue? ...

Is Knockout opposed to having an HTML tag nested inside another tag?

I am currently constructing a webpage using knockout 3.0. My goal is to implement a Bootstrap list with badges, as shown in the example and code below However, when I try to achieve this within the knockout template binding like so <script type="text/ ...

Utilizing the retina pixel ratio media query in Internet Explorer 8

I'm currently working on a project to develop a responsive website using SASS/Compass, and I am incorporating retina icons by utilizing generated sprites. In my .scss file, I have created a mixin for including these icons. Here is my mixin for retina ...

Center alignment is not being applied to the SVG element

I am currently working with React and when my component renders, it displays an SVG inside a div. Here is a snippet of the code: render() { return( <div class="myClass"> <svg> ... </svg> </div> ); ...

Unable to export to Excel using TableTools feature

Trying to export a DataTable view to Excel using the TableTools plugin, but encountering issues with the "Excel" button not working. Without a step-by-step tutorial for guidance, here's the code used in a test HTML: <!DOCTYPE html> <html ...