I'd like to have different classes added to td elements based on what they contain (if the text in the cell is "hello", this would result in class="hello", for example). I thought I could use <template> to achieve this, but I can't seem to figure it out.
Which adds another td element within the td element, with a class matching the current row's name value. But how can I add this class to the outer td element?
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.
I'd like to have different classes added to
td
elements based on what they contain (if the text in the cell is "hello", this would result in class="hello", for example). I thought I could use<template>
to achieve this, but I can't seem to figure it out.The closest thing I've gotten is:
Which adds another
td
element within thetd
element, with a class matching the current row'sname
value. But how can I add this class to the outertd
element?