Coder Social home page Coder Social logo

angular-table-resize's Introduction

angular-table-resize

An AngularJS module for resizing table columns!

Demo

You can try out a demo by clicking here. You can also use the demo as an example for implementing the module on your own page. The source can be found in the gh-pages branch

Installation

Bower

bower install angular-table-resize

NPM

npm install angular-table-resize

Setup

Link style sheets

<link rel="stylesheet" href="/angular-table-resize.min.css">

Import dependencies

<script src="/jquery/dist/jquery.min.js"></script>
<script src="/angular/angular.js"></script>

Import the Angular module

<script src="/angular-table-resize.min.js"></script>

Use

Make sure your app imports the module

angular.module('myApplication', ['ngTableResize']);

On a HTML table tag put the resizeable directive

<table resizeable mode="resizeMode" id="myTable">
    ...
</table>

The attribute mode references a variable on the controller, specifying the current resizing mode. In the example above this variable could be

$scope.resizeMode = "BasicResizer"

Saving column sizes

The module automatically saves the current column width to localStorage. This however requires that you supply your <table> with an id and all of your table headers <th> with and id as well.

Resizing Modes

The resize mode can be set to any of these modes. Choose the one that works best for you.

Resize Mode Description
BasicResizer Only the two adjecent cell are resized when dragging a handler. Cell widths are always in percentage
FixedResizer First columns is width auto. Subsequent column sizes are never changed after resizing
OverflowResizer Table may expand out of its container, adding scrollbars. Columns are always the same size after resizing

N.B. You can implement your own resizer model to use with the module. Instructions coming soon.

angular-table-resize's People

Contributors

tympanix avatar rockydd avatar jiaming10 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.