I have a table that displays calendar dates retrieved from a mysql database with php. Each row represents a month, and each td is a date in that month. There will be max three visible dates in each row, after which they will be hidden, to be viewed with a js carousel:

```
          |---------visible area---------|----hidden area----|           

tr (OCT): |    td        td        td    |
tr (NOV): |    td        td        td    |    td        td
tr (DEC): |    td        td              |

```

I need a way to set the width of each tr after it is populated by tds. If each td is 20rem, the top row would be 60rem, middle 100rem, and bottom 40rem. I have tried echoing javascript with php, but it hasn't worked:

```
echo '<script>$("#' . $monthWord . '").css("width","' . ($numDates * 20) . 'rem");</script>';

```

What do you suggest? Thanks for any help.