Git Product home page Git Product logo

sticky-table's Introduction

Sticky Table

Sticky Table is a jQuery plugin that gives you the ability to make any table element on your page always stay visible.

Demo

Full Sticky , Sticky Left Top , Sticky Top Bottom , Sticky Top Right , Sticky Left Right

Usage

  • Include jQuery & Sticky Table.
  • Call Sticky Table.

Create table like hmtl example:

  • Class name .sticky-table
  • Attribute : data-sticky-top,data-sticky-left,data-sticky-right,data-sticky-bottom
<script src="jquery.js"></script>
<script src="sticky.js"></script>
<link rel="stylesheet" type="text/css" href="../stickytable.css">

<table class="table-sticky" 
data-sticky-top="thead tr" 
data-sticky-left="tbody tr td:first-child, tr th:first-child"  
data-sticky-bottom="tfoot tr" 
data-sticky-rigth="tbody tr td:last-child, tr th:last-child">
    <thead>
        <tr>
            <th>Sticky</th>
            <th>header</th>
            <th>header</th>
        </tr>
    </thead>
    <tbody>
        <tr>
           <th>Data</th>
           <th>Data</th>
           <th>Data</th>
        </tr>
    </tbody>
    <tfoot>
        <tr>
           <th>Sticky</th>
           <th>Footer</th>
           <th>Footer</th>
         </tr>
    </tfoot>
</table>

Or Call function sticky(option)

 $('.selector-table').sticky({
    top:"",
    bottom:"",
    left:"",
    right:""
 });

####Options

  • top: selectors row need sticky header.(eg:table tr:first-child)
  • bottom: selectors row need sticky footer(eg:table tr:last-child)
  • left: selectors row need sticky Left.(eg:table tr td:first-child)
  • right: selectors row need sticky Right(eg:table tr td:last-child)

Methods

  • sticky(options): Initializer. options is optional.
  • sticky(): Initializer. options is optional.
  • unstick(): Recalculates the element's position.

Events

  • sticky-table-start: When the element becomes Sticky Table.
  • sticky-table-sucsses: When the element becomes Sticky Table.
  • sticky-table-removed: When the element becomes Sticky Table.

sticky-table's People

Contributors

lethevinh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.