I am building a dynamic table that fetches and displays data from database, the structure of table looks like this
<table class="table" id="report">
<thead>
<tr>
<th>Title</th>
<th>Skill</th>
<th>Area</th>
</tr>
</thead>
<tbody>
<?
$sql="SELECT * from tablename ";
$result= mysqli_query($con, $sql);
if(mysqli_num_rows($result)>0) {
while($row = mysqli_fetch_assoc($result)) {
<tr>
<td><? echo $title; ?></td>
<td><? echo $skill; ?></td>
<td><? echo $area; ?></td>
</tr>
}
}
</tbody>
</table>
I wish that when a user clicks on title a view should expand and then on another click it should collapse.
I built a static table in jsfiddle and it was working fine, but when I tried to merge the code with my above table it is not working. Can anyone please tell where I went wrong?