Skip to content

Repository files navigation

angular-scrollable-table

Yet another table directive for AngularJS.

This one features a fixed header that elegantly handles overly-long column header names.

Other features:

  • Scroll to row
  • Sortable header with custom comparator functions
  • Resizable columns

Installation

npm install angular-scrollable-table

OR

bower install angular-scrollable-table

Usage

angular.module('myApp',['scrollable-table', ...]);

Example

<scrollable-tablewatch="visibleProjects"><tableclass="table table-striped table-bordered"><thead><tr><thsortable-headercol="facility">Facility</th>
...
</tr></thead><tbody><trng-repeat="proj in visibleProjects" row-id="{{ proj.facility }}" ng-class="{info: selected == proj.facility}" ><td>{{ proj.facility }}</td>
...
</tr></tbody></table></scrollable-table>

where the controller contains

$scope.visibleProjects=[{facility: "Atlanta",code: "C-RD34",cost: 540000,conditionRating: 52,extent: 100,planYear: 2014}, ...];$scope.$watch('selected',function(fac){$scope.$broadcast("rowSelected",fac);});})

Third-party dependencies:

  • jQuery
  • Bootstrap 3 CSS (for styling, optional. See the 'bootstrap2' branch also)

Demo here: https://jsfiddle.net/alalonde/BrTzg/

More infomation here: http://blog.boxelderweb.com/2013/12/19/angularjs-fixed-header-scrollable-table/

License: MIT

FAQ

  1. How do I change the height of the table?

    See here: https://jsfiddle.net/alalonde/qgc2gp7d/2/

About

A fixed header table directive for AngularJS

Resources

Stars

68 stars

Watchers

9 watching

Forks

Releases

Packages

Used by

Contributors

Languages