What is the reason behind IE7 and IE8 claiming to have 'hasLayout' when in reality it does not possess such a feature?

HTML:

  <div class="table" >
      <div class="row" >
        <span>Table with DIV</span> <span>column2</span> <span>column3</span>
      </div>
        <div class="row" >
        <span>column1</span> <span>column2 test</span> <span>column3</span>
      </div>
        <div class="row" > <span>column1</span> <span>column2</span> <span>column3 test</span>
      </div>
    </div>

    <table>
      <tr id="testRow">
        <td>Table with <'table'></td> <td>column2</td> <td>column3</td>
      </tr>
      <tr >
        <td>column1</td> <td>column2 test</td> <td>column3</td>
      </tr>
      <tr >
        <td>column1</td> <td>column2</td> <td>column3 test</td>
      </tr>
    </table>

CSS:

.table, table {
    display:table; 
        /*
        width:200px; 
        height:100px;
        zoom:1;
        */
        }
.row  { display:table-row; }
.row, tr {
        width:200px !important;
        min-height:1px !important;
        zoom:1;
        white-space:nowrap;

   -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
    filter: alpha(opacity=20);
    -moz-opacity:0.2;
    -khtml-opacity: 0.2;
    opacity: 0.2;
}
.row span, td {display:table-cell;padding: 5px;}

Javascript

$(function () { 
    console.log (document.getElementById('testRow2').currentStyle.hasLayout);
    //$('.row, tr').fadeTo('fast',0.2);
});

jsbin jsfiddle

Since the opacity is not functioning properly, 'false' should be displayed in the console (for IE7&8), but it actually shows 'true'

Is the element truly 'hasLayout' BUT the opacity is not working for some other reason?

Even jQuery cannot set the opacity as expected.

Answer №1

It appears that every "table" element automatically has a property of hasLayout===true. Attempting to adjust the opacity of tr will not produce the desired effect; you must adjust the opacity of td instead.

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

Tips for verifying phone numbers on an HTML form

Need assistance with validating a 10-digit number input. The first two digits must be either '05' or '06'. Seeking guidance on how to achieve this validation in PHP or JavaScript. Appreciate any help, thanks! ...

Trigger the "onChange" event when the input element is modified by JavaScript within a popup window

On my webpage, I have a form element and a popup window (which is opened using window.open). Both the form element and the popup window utilize jQuery. The JavaScript in the popup window has the ability to alter the form element on the main page successf ...

Steps to eliminate <br> tags from text nodes and enclose them in <p> tags while including <b>, <i>, <a>, and other elements

My current status (UPDATED): <div class="entry-content"> <h1>This heading won't be shown</h1> Written by: Me <br></br> On: 01/01/2017 <br></br> <br></br> When quoting: ...

Media queries in IE9 for CSS with specific conditions based on the height of

We are implementing a CSS media query to adjust styles for mobile devices, specifically increasing the height of select elements for easier selection. Here is an example: @media only screen and (max-width: 599px) { .mySelect { height: 40px; ...

Aligning the Bootstrap navbar to the right causes the items to shift to the left

UPDATE: The issue has been resolved. It turns out that the navbar was not extending to 100% width and reaching the edges of the screen. I am currently facing a challenge with a Bootstrap 4 navbar, similar to issues I encountered with the previous version. ...

Different ways to modify the style of a MenuItem component in PrimeNG

Seeking advice on customizing the look of a MenuItem in PrimeNG. Here's what I have attempted so far: <p-menu [style]="{'width': '400px'}" #menuOpcoesLista popup="popup" [model]="opcoesListaCS" appendTo="body"></p-menu> ...

Encountered a problem while rendering the app: [TypeError: Unable to assign a value to the property 'content' since it is undefined]. Implementing Express with

My experience with res.render is flawless: res.render('main', function(err, html){ // Displays '<html></html>' from 'views/main.html' console.log(html); }); However, the situation changes when it comes to ...

The Bootstrap website appears visually appealing on desktop browsers, but the div elements are failing to display correctly on mobile devices

After using Bootstrap to create a multi-row, multi-column site, I encountered an issue with resizing on mobile devices. The divs misalign, stack on top of each other, content disappears, and images flatten to the point of invisibility. How can I maintain t ...

using javascript to dynamically color rows in a table based on the value in the status field

Hi, I'm new to javascript and seeking help for my table coloring issue. I have a dynamic table where data is inserted through an Ajax call. The goal is to color specific records based on their status. I attempted a solution but only one record gets c ...

Div element to animate and vanish in a flash

I'm attempting to create a smooth slide effect for a div element before it disappears. Below is the code I am currently using: function slideLeft(element) { $("#" + element).animate({ left: "510" }, { duration: 750 }); document.getEle ...

Generate a fresh object if the values within the TypeScript object are identical

How can I filter an object to return a new object containing elements with the same values? For example: allValues = {"id1": 3, "id2": 4, "id3": 3} The desired output is: filteredValues = {"id1": 3, "id3": 3} This is because the keys "id1" and "id3" hav ...

Guide on how to turn off cache in AngularJS + NodeJS CRUD application

I'm encountering an issue with cache in Internet Explorer, but everything seems to be working fine in Chrome. Whenever I try to add an item in my application, the data doesn't refresh automatically and I have to press Ctrl+R to manually refresh. ...

What is the best way to center text vertically in a <div> using CSS?

This is my first attempt at creating a chrome extension, and I am currently working on centering text. Right now, I am using text-align: centre; to align the text horizontally, but I am struggling to figure out how to align it vertically. As a result, my t ...

The new version 5.1 of Bootstrap modal does not disable scrolling on the <body> element

I'm currently working on a project in Angular 11 using Bootstrap (v5.1.3). My main goal is to create a functionality where clicking on a card, similar to a blog post, will trigger a Bootstrap modal popup displaying the content of that specific post. B ...

The importance of understanding Req.Body in NODE.JS POST Requests

Currently, I am developing a Node.JS application that interacts with a MySQL database. The app retrieves data from the database and displays it in a table using app.get, which functions correctly. The issue I am facing is that when utilizing app.post, re ...

"Achieving Alignment: Placing a Div Element Inside an H

I am in the process of building a portfolio for freecodecamp, but I am having trouble with centering the button and row div on the page. The row div is necessary because I will be adding more buttons later on, but for now I just need the FCC button. Below ...

Learn how to specify types for the accumulated value and initial value when using the reduce function with an array in TypeScript

I am currently running this code on the typescriptlang.org (typescript playground) After learning about the importance of types in TypeScript and how to use them in functions, I am having trouble adding specific types within this reduce method: // Types f ...

What's causing the unexpected rendering outcome in Three.js?

Here is a mesh created in Blender: https://i.sstatic.net/KBGM5.jpg Upon loading it into Three.js, I am seeing this result: https://i.sstatic.net/PCNQ8.jpg I have exported it to .obj format and ensured all faces are triangulated. I am not sure why this is ...

Imitating Long Polling technique causing delays in rendering the entire webpage

Summary In my turn-based web app, each turn has a 60-second limit. If a user ends their turn before the 60 seconds are up, the next user automatically begins their turn. The mechanism behind this involves a PHP page where data generation is controlled by ...

The Material UI text field on mobile devices causes the screen to zoom in, cutting off the top content and displaying the bottom of the page

Whenever I click on the Material UI text Field during login, the screen gets pushed down and cuts off content at the top of the page. View image description here -I have examined my CSS to see if setting the container height to 100vh is causing this issue ...