npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fix-table-header

v1.0.3

Published

A jQuery plugin to fix header or footer row in a table on scroll

Downloads

806

Readme

jQuery-FixTableHeader

A jQuery plugin to fix header or footer row in a table on user scroll

This plugin does exactly what it says. Fixing the headings and/or the footers in a HTML table is made easy by this plugin

Version 1.0 | Invoking the plugin | Options | Important

View a demo here.

###NPM npm i fix-table-header

##Version 1.0

jQuery.fixTableHeader.js

  • fix header and/or footer with options
  • no alterations to existing table needed, just wrap it around a container and call this plugin.
  • no dynamic element created for fixing header and footer, this just uses the existing elements (th and td)
  • perfect table layout not needed, just works with few tr in iside a table.
  • Supports fixing multiple rows in header/footer by using the thead/tfoot tag. Any number of rows within these tags will be fixed
  • Tables with horizonal scrolling(responsiveness) is supported
  • Super light: just a 2kb plugin

Patch v1.0.3

  • adds classes to header and footer cells, fth-header and fth-footer respectively for optional CSS styling.
  • fixed the position of footer when the container has a horizontal scrollbar

##Invoking the plugin The table should be wrapped inside a container div with overflow:auto and a fixed height if necessary. Eg table:

<div id="tbMarksContainer" style="height:400px;overflow:auto;">
    <table id="tbMarks">
        ...
    </table>
</div>
  • invoke using the container div's ID - $('#tbMarksContainer').fixTableHeader();

##Options

  • fixHeader : true/false (default -> true) [fix or not to fix the header]
  • fixFooter : true/false (default -> false) [fix or not to fix the footer]

Examples: $('#tbMarksContainer').fixTableHeader({fixHeader:true,fixFooter:true}); $('#tbMarksContainer').fixTableHeader({fixHeader:false,fixFooter:true});

The plugin adds the classes fth-header and fth-footer to the ths and tds to all the detected headers and footers respectively. You can use this classes to manipulate thier appearance in your CSS.

Example:

td.fth-header,th.fth_eader,td.fth-footer{
      border-top:none;
      border-bottom:none;
   }

##! Important

  • A drawback: borders applied to the headers and footers wont be preserved while scrolling (researching, if this can be fixed).
  • It is recommended to avoid border-top and border-bottom on the th or td which is going to be the header or the footer.
  • It is important to keep a solid color or an image as background to the headers and footers to avoid any transparency while scrolling.