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

jquery-xtable

v0.5.0

Published

Cell selection API for HTML tables on top of jQuery

Downloads

14

Readme

Build Status npm version Bower version

jQuery XTable

Introduction

XTable provides a table selection API for HTML tables on top of jQuery. XTable augments the base jQuery object with a table function. The developer can use this table function to construct a XTable object. Via the XTable object, the developer can access XTable methods in addition to standard jQuery ones.

License | Supported Platforms | Table selectors | User selection

Summary

For example:


var obj = $.table('table.buster')

gives you access to a suite XTable methods. These methods include:

  • base/basis - set/return the origin for coordinate mapping
  • row/xrow - select a row by passing in the row number
  • column/xcolumn - select a column by passing in the column label
  • cell/xcell - select a cell by passing in the cell label

#Examples

Styling

To set the background color of cells in row 2 to red:

$.table('table').row(2).css('background-color', 'red');

To set the text color of cells of A1 to D2 to blue:

$.table('table').range('A1:D2').css('color', 'blue');

Find the title element in cell A1 and hide it:

$.table('table').cell('A1').find('.title').hide();

Data Extraction

To get the text of the first row:

$.table('table').row(1).text()

To get the text of the A1 cell:

$.table('table').cell('A1').text();

To get the value of the A1 cell:

$.table('table').cell('A1').value();

Statistics

To sum column D in table.mlb:

$.table('table.mlb').column('D').sum()

To calculate the average of column D in table.mlb:

$.table('table.mlb').column('D').avg()

Coordinate Remapping

Remap coordinates by skipping the first header row. Retrieve the value of the A1 cell with the new coordinate mapping.

$.table('table').base('A2').cell('A1').value()

Remap coordinates by skipping the first header row and first header column. Retrieve the value of the A1 cell with the new coordinate mapping.

$.table('table').base('B2').cell('A1').value()

User Selection

To enable user selection:

$.table('table').enableUI();

To get cells selected by user:

$.table('table').selection