I am trying to set an html table to a fixed height (around five rows), scrollable with the headers fixed. I tried setting tbody to overflow-y: scroll, and the rule isn't showing up in Chrome or Firefox. I also tried setting the parent div's height. When I set display to block, it just shrinks the width of the div.
tbody.datatable{
width:630px;
height:100px;
overflow-y: auto;
}
Is there any other element in my html that is preventing tbody from being scrollable?
Here is my jsfiddle: https://jsfiddle.net/29jr5eo8/
EDIT: solutions have been linked that set display:block --this makes headers change width, and my table is still not changing height. It seems like the problem is class="divtable" is not showing up in the css calculation rules. display:block has no effect on the height of the div.