belhard/floatthead

Float the table header on scroll.

Fund package maintenance!
mkoryak

Installs: 1 761

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 196

Language:JavaScript

dev-master 2019-11-01 10:25 UTC

This package is not auto-updated.

Last update: 2024-04-28 07:09:19 UTC


README

jquery.floatThead 687474703a2f2f696d672e626164676573697a652e696f2f68747470733a2f2f756e706b672e636f6d2f666c6f617474686561642f646973742f6a71756572792e666c6f617454686561642e6d696e2e6a733f636f6d7072657373696f6e3d677a6970267374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f666c6f617474686561642e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f6c2f666c6f617474686561642e7376673f7374796c653d666c61742d737175617265

woot

Documentation & Examples: http://mkoryak.github.io/floatThead/

Float the table header on scroll. No changes to your HTML/CSS are required, it just works. Supports floating the header while scrolling within the window or while scrolling within a container with overflow. Supports responsive tables.

Install

Package managers

npm install floatthead
bower install floatThead

Download code

Latest Release (zip)

Via CDN

https://cdnjs.com/libraries/floatthead/
https://www.jsdelivr.com/#!jquery.floatthead
https://unpkg.com/floatthead

<!-- Latest compiled and minified JavaScript -->
<script src="https://unpkg.com/floatthead"></script>
<script>
  $(() => $('table').floatThead());
</script>

For java people

Webjar

Wrappers

vuejs component by @tmlee

angularjs directive by @brandon-barker

yii2 framework wrapper by @bluezed

Things this plugin does:

  • In prod @ big corporations and opensource projects. Maintained. See open issues.
  • Works on tables within a scrollable container or whole window scrolling
  • Works with responsive table wrappers
  • Works with dynamically hidden/added/removed columns
  • Does not clone the thead - so your events stay bound
  • Does what position:fixed cannot do (and on browsers that do not support it)
  • Does not mess with your styles, and doesnt require any css (see fixed vs absolute position modes)
  • Works with border-collapse variants, weird margins, padding and borders
  • Works with libs like datatables, perfect-scrollbar, bootstrap3, and many more
  • Header can be floated with position:absolute which adds a wrapper, or position:fixed which does not. Both have their pros and cons. By default the best option is chosen based on your configuration

Things this plugin does NOT do:

  • Does not float the footer
  • Does not let you lock the first column like in excel
  • Safari and mobile safari are not supported. It might work, or it might not, depending on your markup and safari version.
  • RTL is not really supported - it might work in overflow scrolling more, if you are lucky. Expects dir on html element.
  • Layout issues resulting from document zoom not being 100% are not supported.

Common Pitfalls

If you use css and html best practices, this plugin will work. If you are stuck in 1999, you better read the faq.

How to get help with the floatThead

All issues should be reported through github. Coffee/Beer donations are welcome ;)

Requirements:

  • jQuery 1.8.x or better (1.9 compliant) (or jQuery 1.7.x and jQuery UI core)

Supported Browsers:

Change Log

see CHANGELOG.md

Who is using floatThead ?

Ctrl O

  • Ctrl O provides simple and innovative products to help an organization's business processes. Linkspace, its flagship product, helps share information between teams and individuals, in a simple and effective manner.

WheresTheGig.com

  • A free service for the musical community

Google

  • Internally, I happen to know...

Samsung

  • For the internet of things!

compat-table

Around 135,000 hits on github code search

License

MIT