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
LVL 2
BILL CarlisleAPEX DeveloperAsked:
Who is Participating?
 
BILL CarlisleAPEX DeveloperAuthor Commented:
Solved:  It likes ATTR() instead of CSS()

Does work:
$('table[summary="Progress"]  input[value="60"]').parent().attr('style','background:linear-gradient(to right, yellow 74%, white 1%)')

Does NOT work:
$('table[summary="Progress"]  input[value="60"]').parent().css('style','background:linear-gradient(to right, yellow 46%, white 1%)')
0
 
Dave BaldwinFixer of ProblemsCommented:
What version of IE and what version of jQuery?  http://jquery.com/download/
0
 
BILL CarlisleAPEX DeveloperAuthor Commented:
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
0
 
BILL CarlisleAPEX DeveloperAuthor Commented:
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 ?
0
 
BILL CarlisleAPEX DeveloperAuthor Commented:
Great answer! :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.