I have a (long) Bootstrap table for which I want to allow for scrolling with overflow: auto;. I only want the tbody to be scrollable, not thead content.
Please see this fiddle for my attempt. I have tried to set a height on tbody unsuccessfully.
You can’t set tbody as scrollable. You need to create two separate tables — one for the header and one for the body. Wrap the body table in a div and set the overflow-y property to scroll.
Updated jsfiddle: http://jsfiddle.net/SzGW3/37/
Markup:
Style:
The scroll bar on the header is to keep the widths the same. You can fix that with some JavaScript, but there should also be some nice JS / JQuery libraries you can find to handle the entire tbody scrolling issue for you.
If you want to set the same width for header cols (th) and cols (td):