I'm using ng-table to display some information. I would like to make the header and footer of the ng-table fixed and force the ng-table to draw scroll bars within the rows.
The ng-table documentation site has no documentation on how to make that happen.
Any ideas?
I don't know about the footer but I had a similar requirement for the headers.
This was requested before @ Github: https://github.com/esvit/ng-table/issues/41
I made my own implementation using a jquery plugin (https://github.com/jmosbech/StickyTableHeaders).
There is a plunkr here: http://plnkr.co/edit/KyilXo?p=preview
Basically we just call the plugin in the directive
data-fixed-table-headers
when the data has been rendered.That is by far the most reliable solution that I found. And I've looked for hours before deciding to use a jQuery plugin. In the version of the plugin that I am using, we can stick the header to a scrollable container. Take a look at this plunker for a use case with ng-table:
http://plnkr.co/edit/ypBaDHIfaJWapXVs3jcU?p=preview
Javascript
HTML
CSS
this CSS-only solution worked for me. Just add the class
table-scroll
to the table element and the following CSS: