I have some forms that are structured using display:table-row
and display: table-cell
. On Firefox 52, I could hide a cell element using visibility:hidden
, hiding the cell but keeping the structure defined by CSS (instead of using display:none
).
On Firefox 64 though (and also chrome), when I hide the visibility of the cell, the parent table-row loses its background color on that position.
Here's a snippet showing the issue:
#tableRow{
display: table-row;
background-color: #f5f5f5;
}
.cell{
display:table-cell;
}
#hide{
visibility:hidden;
}
<div id="tableRow">
<a href="#" class="cell">Visible</a>
<a href"#" class="cell"id="hide">Not visible</a>
<a href="#" class="cell">Visible</a>
</div>
I tried using opacity: 0
but some elements are clickable or have different events and opacity on 0 won't help.
Any thoughts? Is this intended?
The HTML <tr> bgcolor Attribute is used to specify the background color of a table row. It is not supported by HTML 5. Attribute Values: color_name: It sets the background color by using the color name.
Add or change a fill color Select the cells in which you want to add or change the fill color. On the Tables tab, under Table Styles, click the arrow next to Fill. On the Fill menu, click the color you want.
The HTML <table> bgcolor Attribute is use to specify the background color of a table. Attribute Values: color_name: It sets the text color by using the color name.
In HTML, table background color is specified using Cascading Style Sheets (CSS). In particular, you use the CSS background-color property to set the background color for your table. You can also specify a separate background color for your table rows and table cells if you like.
I would consider box-shadow to simulate a background coloration and avoid this bug *
.container {
display: table;
}
#tableRow {
display: table-row;
box-shadow: -100vw 0 0 red inset;
}
.cell {
display: table-cell;
padding: 10px;
}
#hide {
visibility: hidden;
}
<div class="container">
<div id="tableRow">
<a href="#" class="cell">Visible</a>
<a href="#" class="cell" id="hide">Not visible</a>
<a href="#" class="cell">Visible</a>
</div>
</div>
*it's probably not a bug but I am not able to find any specification describing this behavior
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With