GithubHelp home page GithubHelp logo

bogdaan / floatthead Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mkoryak/floatthead

0.0 3.0 0.0 873 KB

Float any table's header without special css

Home Page: http://mkoryak.github.io/floatThead/

License: Other

floatthead's Introduction

jquery.floatThead v1.2.1

Float the table header without special css. This plugin assumes nothing about your table markup and "just works" without losing your events or styles. Supports floating the header while scrolling within the window or while scrolling within a container with overflow.

Check out the demo / docs page for copious examples:

###Demos and Docs

Jekyll templates to generate the docs are in the gh-pages branch

Donate

Feedback needed on planned features

See: mkoryak#30

Install:

Install using Bower:

bower install floatThead

or download:

Features:

  • Floats the table header - so that the user can always see it
  • Supports tables with inner scroll bars, or whole page scrolling
  • Horizontal or vertical scrolling
  • Doesn't clone the thead - so your events stay bound
  • Doesn't mess with your styles
  • Works on any table
  • Requires no special css
  • Works with datatables out of the box

Requirements:

  • jQuery 1.8.x or better (1.9 compliant) (or jQuery 1.7.x and jQuery UI core)
  • Underscore.js 1.3 or better
  • IE8, IE9, IE10, IE11, FF10+ or Chrome15+.
  • The following meta tag to placate IE: <meta http-equiv="X-UA-Compatible" content="IE=10; IE=9; IE=8; IE=7; IE=EDGE" />

Demo & Docs:

DEMOS and Documentation

Using with IE9

FloatThead will not work properly in IE9 unless you have the following meta tag in the head of the page:

<meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE" />

With very big tables, you may also run into this exciting bug: http://stackoverflow.com/questions/5805956/internet-explorer-9-not-rendering-table-cells-properly
Watch for it.

Change Log

1.2.1

  • fixed issue with caption tag align:bottom
  • switched to uglifyjs to minify code

1.2.0

  • caption tag support
  • faster initialization when working with large tables (and small ones)

1.1.1

  • Fixed bugs introduced in 1.0.0 which caused issues in IE9

1.0.0

  • Updated code to be jquery 1.9+ compliant

Other plugins

There are plenty of other fixed header / floating header / scrolling table header plugins that attempt to do the same thing this plugin does. None of them support both window and overflow scrolling and many of them depend on special css or require that you set the table column widths. Some of them are good and some of them suck. Go ahead and check them out too.

I have compiled a list here with comments on each one:

| Plugin | Window Scrolling | Overflow-X Scrolling | Overflow-Y Scrolling | No Special CSS | Keeps Bound Events | Freeze Columns | |:-------------:|:-------------:|:-----:|:-------------:|:-------------:|:-----:|:-----:|:-----:| | FloatThead | yes | yes | yes | yes | yes | no | | Fixed-Table-Header | no | yes | no | yes | no | no | | jquery.scrollTableBody | no | yes | yes | no | ?? | no | | Fixed table rows cols | no | yes | yes | no | ?? | yes | | Table Fixed Header | yes | no | no | yes | no | no | | Sticky Table Header | yes | no | no | yes | yes | no | | Grid | no | yes | yes | yes | yes | no |

Fixed-Table-Header This is the orignal. It has been around for ages and it will be the first plugin you find when you start looking. It also has a ton of open unresolved issues. It does not support window scrolling, it does not seem to support y-scrolling withing the container. It loses the events you attached to the thead. Stay away.

Fixed table rows cols Does not support window scrolling. Requires you to specify the column widths for the table. This means that the table will not be able to optimally lay itself out. It does support freezing columns in place. If you need that, this might be the plugin for you.

jquery.scrollTableBody Does not support window scrolling. A newcomer to the scene, not a mature project. Has some major issues with cell padding. Stay away until issues are resolved.

Grid This lib is very different from the rest because its main usecase is to give you a sortable grid. You do not run this plugin on an existing table - you need to provide a json or xml data source. This is a great lightweight replacement for datatables. This may be the plugin for you if you are not converting an existing table.

Table Fixed Header This is a window scrolling plugin, does not support overflow scrolling. Does not work properly when the window is resized and the table width changes. Floated header sticks around if you scroll past table. Author welcomes pull requests but does not fix issues. Stay away

Sticky Table Header This is a window scrolling plugin. Does not support overflow scrolling. It is probably the best window scrolling plugin (besides this one). The author seems to fix issues as they arise.

License

CC BY-SA 4.0

floatthead's People

Contributors

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