Code Monkey home page Code Monkey logo

freezetable's Introduction

jquery.freezetable

The jquery.freezetable plugin freezes the header row of a table and adds a scroll bar to allow a long table to be scrolled vertically.

Overview

jquery.freezetable when applied to a table will freeze the top table header and add vertical scroll bars to the body of the table.

The table markup needs to adhere to the HTML 4.01 Specification for Tables. The row groups THEAD and TBODY are used to determine which sections of the table should be frozen. jquery.freezetable clones the table and removes the TBODY from the cloned copy to 'freeze' the header. It then removes the THEAD from the original table to make the scrollable portion of the table. jquery.freezetable also depends on COLGROUP to maintain consistent column styling between the orginal and cloned header table.

###Expected <table> markup

<table id="mytable">
  <colgroup>
    <col class="column-make" />
    <col class="column-display" />
    <col class="column-country" />       
  </colgroup>
  <thead>
    <tr>
      <th>make_id</th>
      <th>make_display</th>
      <th>make_country</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>abarth</td>
      <td>Abarth</td>
      <td>Italy</td>
    </tr>
  </tbody>
</table>

###Usage

$(document).ready(function () {
    $('#mytable').freezeTable({
        'autoHeight': false,
        'height': 160
    });
});

Options

height

The height of the scrollable part of the table. Only used when 'autoHeight' is true.

Integer - Default: 480

scrollbarWidth

The width of the area to the right of the table reserved for the scrollbar.

Integer - Default: 20

autoHeight

When 'true' the scrollable section of the table will streach to fill the browser window. When 'false' the scollable section of the table will determined by the 'height' option.

Boolean - Default: false

autoHeightMarginBottom

The size of the margin between the bottom of the browser window and the table when 'autoHeight' is true.

Integer - Default: 20

freezetable's People

Contributors

jacksonakj avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

without-yy

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.