How do I highlight cells in a specific row via the Excel Export?

How do I highlight cells in a specific row via the Excel Export?

joshuahedgesjoshuahedges Posts: 4Questions: 2Answers: 0

I want to specify a row and a cell to highlight. I got the cell down, but how do I specify a row?
$('**Row index here?*** c[r^=\"D\"]', sheet).attr( 's', '20' );

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    This thread shows how to colour individual cells, so it should get you going.

    Colin

  • joshuahedgesjoshuahedges Posts: 4Questions: 2Answers: 0

    Colin, I've been working with that bit of code and it seems to highlight the whole K column regardless of what row it is...
    $('row c[r^="K"]', sheet).each( function () {
    ...
    });

    I need something that is like...
    $('row[5] c[r^="K"]', sheet)..attr( 's', '20' ); //row 5 column K highlight there.

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    I just took a look, you can use standard selectors, such as row:nth-child(2), see my example from that earlier thread updated here.

    Colin

  • joshuahedgesjoshuahedges Posts: 4Questions: 2Answers: 0

    Thanks Colin, that's exactly what I needed!

This discussion has been closed.