I want to add a scroll bar vertically to my html dynamic table. I have put my table inside a div, but it doesn't seem to be working. please help
this is my html code
<thead>
<tr>
<td colspan="5">
<div class="scrollit">
<th><span>ID</span></th>
<th><span>Name</span></th>
<th><span>Location</span></th>
<th><span>Date</span></th>
<th><span>Catagory</span></th>
</div>
</td>
</tr>
</thead>
php code
print "<tr>";
print "<td>";
print "<div>";
print "<td >" . $row['ID'] . "</td>";
print "<td >" . $row['Name'] . "</td>";
print "<td >" . $row['Location'] . "</td>";
print "<th >" . $row['Date'] . "</th>";
print "<td >" . $row['Category'] . "</td>";
print "</div>";
print "</td>";
print "</tr>";
}
print "</table>";
css code:
.scrollit {
overflow:scroll;
height:100px;
}
By the way, I retrieve data from the database to the table.