locked
JQuery Cell colouring only applying on alternate rows RRS feed

  • Question

  • Morning all,

    My platform is SharePoint 2007 Standard.  Pattch 12.0.0.6676

    I've used some JQuery to alter a rendered view on a custom list.  In each of my columns a word is choosen from a list drop down.  From this, the Jquery (applied via a hidden CEWP) will use these values to apply a specific colour.

    Upon page rendering, my stying is only being applied on altenate rows.  I'm wondering if this is something that the community has seen before and if so, how was this fixed?

    And here is the CSS ussd to implement the cell colouring

    $("td").filter(function() { 
         return $(this).text() == 'Value to Match'; 
    })
    .css("color", "red");
    
    Cheers,
    Steven


    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles: CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

    Monday, November 18, 2013 10:06 AM
    Answerer

All replies

  • Hi Steven, can you posted the HTML that is generated for the first couple of rows? I suspect the style is being set on a different level than the td.


    Dimitri Ayrapetov (MCSE: SharePoint)

    Sunday, December 1, 2013 8:29 PM