JSFiddle - React, Tailwind, and code Playground

by NickU

HTML

<table border=1>
<tr trid="1">
   <td>cell 1</td>
   <td>cell 2</td>
   <td>cell 3</td>
</tr>
<tr trid="2">
   <td>cell 1</td>
   <td>

       <table border=1>
        <tr>
           <td>cell 1</td>
           <td>cell 2</td>
           <td>cell 3</td>
        </tr>
        <tr>
           <td>cell 1</td>
           <td>cell 2</td>
           <td>cell 3</td>
        </tr>
       </table>

   </td>
   <td>cell 3</td>
</tr>
<tr trid="3">
   <td>cell 1</td>
   <td>cell 2</td>:first
   <td>cell 3</td>
</tr>
</table>

CSS

td{background-color:white;}

JavaScript

$('tr[trid] >td').each(function(index)
    {
        //gets properties of TR here

            $(this).css('background-color', 'red'); //turn my cells red

    });