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

@cityssm/bulma-sticky-table

v3.0.0

Published

A Bulma-friendly way to stick a table header, table footer, first column, or all three!

Downloads

370

Readme

bulma-sticky-table

npm (scoped) Codacy grade

Screenshot

A Bulma-friendly way to stick a table header, table footer, first column, or all three!

See It In Action

Installation

Download a release, or grab the code from npm.

Bulma v1 or newer

npm install @cityssm/bulma-sticky-table

Bulma v0.9.4 or older

npm install @cityssm/[email protected]

When building your stylesheet, import _sticky-table.scss AFTER you import Bulma. This will ensure your colour customizations are used.

@import 'bulma/bulma';
@import '@cityssm/bulma-sticky-table/sticky-table';

Alternatively, if you are using Bulma without any customizations, you can replace your Bulma stylesheet with bulma-with-sticky-tables.css.

<link
  rel="stylesheet"
  href="path/to/cityssm/bulma-sticky-table/bulma-with-sticky-table.css"
/>

Need a CDN? Check out JS Deliver.

Usage

Build your Bulma table as per usual, using the Bulma Table Documentation as your guide.

Then, add any combination of the following classes to your <table> tag.

Use .has-sticky-header to stick the header.

  • Note that the header should be inside of a <thead> tag, and each cell should use a <th> tag.

Use .has-sticky-footer to stick the footer.

  • Note that the footer should be inside of a <tfoot> tag, and each cell should use a <th> tag.

Use .has-sticky-column to stick the first column.

  • Note that the first cells in each table row should use the <th> tag.

Note about .table-container

The Bulma .table-container wraps around a .table to assist with scrolling around large tables. The basic idea is that the container changes the overflow CSS rules on the container. This can affect the .table's ability to stick as you'd expect.

While .has-sticky-column will likely work as expected, .has-sticky-header and .has-sticky-footer may not. There are two options:

  1. Remove the .table-container altogether, and just use the .table as is with the desired sticky classes.

  2. Add some additional styles to the .table-container to change the vertical overflow rule and set a specific height on the container. The example below uses the screen height. Something smaller may be better, depending on your application.

<div class="table-container" style="overflow-y:auto;max-height:100vh;">
  <table>
    <thead>
      ...
    </thead>
    <tbody>
      ...
    </tbody>
  </table>
</div>

Thanks

Made with Bulma

Heavily inspired by code found on CSS-Tricks.