Link to home
Start Free TrialLog in
Avatar of BILL Carlisle
BILL CarlisleFlag for United States of America

asked on

Percent highlighting of rows of a small report that works great in Chrome but not in IE

Hi all.. I have percent highlighting of rows of a small report that works great in Chrome but not in IE.

Chrome works with the below and show percentage when text was 86% it shows color for 86% of the table cell.
linear-gradient(to right, yellow "+$( this ).text()+", white 1%

IE doesn't show an error but shows no color

$(document).ready(function() {
  $('table[summary="Progress"] td[headers="PERCENT_COMPLETE"]').each(function( index ) {
    if( $( this ).text() != '0%' && $( this ).text() !='100%' ){
      // Yellow     console.log( index + ": " + $( this ).text() );
      $( this ).parent().find("td:first").css("background","linear-gradient(to right, yellow "+$( this ).text()+", white 1%");
    } else if( $( this ).text() =='100%' ){
      // Green for 100%
      $( this ).parent().children().css('background','green')
    } 
  });
});

What would I use that would work in IE, Chrome, Firefox?

Open in new window


Thank you,
Bill
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

What version of IE and what version of jQuery?  http://jquery.com/download/
Avatar of BILL Carlisle

ASKER

IE 11.0.9600
jquery-ui/1.8/ui/minified/jquery.ui.tabs.min.js
jquery.autotab.min.js

jquery-ui/1.8.22/themes/base/jquery-ui.min.css
jquery-ui/1.8/themes/base/jquery.ui.tabs.css
Ok, I pinpointed one td and used the gradient and it works, so I would say it is NOT the gradient code that is my problem

this works:
$('table[summary="Progress"]  input[value="60"]').parent().css('background','linear-gradient(to right, yellow 46%, white 1%)')

So I would say it is my selector
$( this ).parent().find("td:first")

does IE have a problem with find td:first ?
ASKER CERTIFIED SOLUTION
Avatar of BILL Carlisle
BILL Carlisle
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great answer! :)