how get cell class and apply attribute while export to excel

how get cell class and apply attribute while export to excel

gcastgcast Posts: 2Questions: 1Answers: 0

Hello guys,

I've been scratching my head for all over a day now but i still can find the right to solution on to how to get the cell class and in order for me to apply attribute base on its class. I'm confuse already for so many stuff I read and does not work on my case and not fit for my need. Hope someone can help me on this... Cheers.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,171Questions: 26Answers: 4,922
    Answer ✓

    I would start with Allan's example in this thread. Its using this to get the background-color:
    var colour = $(table.cell(':eq('+count+')',2).node()).css('background-color');

    You can use something similar to by using jQuery hasClass() to see if the cell has the class. Or use whatever method you like to determine the class. Then set the cell attribute.

    If you still need help with this then please provide a link to your page or a test case showing the issue so we can see what you have.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • gcastgcast Posts: 2Questions: 1Answers: 0

    Many thanks @kthorngren, I able to solve my problem just adapting the same idea from that threads.

    Cheers :)

This discussion has been closed.