Toggle open div inside table col onClick with React/Next.js and Tailwind

Viewed 22

I am trying to toggle slide open a div inside of an inner table column, so that additional info can be displayed by clicking each column of a table with React/Next.js and Tailwind.

Could someone please help with the basic structure of how to achieve this?

return (
<table>
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>
  <tr>
    <td>Alfreds Futterkiste</td>
    <td>Maria Anders</td>
    <td>Germany</td>
  </tr>
  <tr>
    <td>Centro comercial Moctezuma</td>
    <td>Francisco Chang</td>
    <td>Mexico</td>
  </tr>
</table>
}```
0 Answers
Related