I am trying to make each heading part which is a table collapsible. The user should be able to click on the heading and view the table and click again to hide it. Something as simple as possible. I found something here: https://www.w3schools.com/howto/howto_js_collapsible.asp that seems like a lot of coding for such a simple thing. Is there a simple way to do it in HTML? I am using it in Thymeleaf as part of spring boot, so if it's done in HTML it should be easily doable in Thymeleaf too. Following is the sample HTML that I am using.
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1> Concepts only in L1</h1>
<table>
<tr>
<th>missing-con</th>
<th>parent-con</th>
</tr>
<tr>
<td>{missing-con}</td>
<td>{parent-con}</td>
</tr>
</table>
<h1> Concepts only in M1</h1>
<table>
<tr>
<th>missing-con</th>
<th>parent-con</th>
</tr>
<td>{missing-con}</td>
<td>{parent-con}</td>
<td>{missing-con}</td>
<td>{parent-con}</td>
</table>
</body>
</html>
And I am looking to collapse each table. Any suggestions?