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

vcl-table

v0.1.0

Published

Display tabular data

Downloads

6

Readme

VCL table

Display tabular data.

Features

The following basic aspects of table formatting are supported through modifiers and other classes:

Cell and column highlighting

Single cells and columns can be highlighted by using the vclCellHighlight class on each tdin the respective column or on single cells only.

Column width

The column width can be defined in the table header using one of the layout spans vclSpan-5p - vclSpan-100p from the corresponding module.

Column sortability

Sortable columns are defined with the vclSortableCol class on the respective ths. This class gives the whole header a pointer cursor on hover to indicate an action. The application must register an appropriate event handler to change the sort order for the whole th accordingly. Also an icon which indicates sortability should be used as shown in the second column. The currently active sort order is indicated by a respective icon and the classes vclSortAsc or vclSortDesc on the th element.

Row and cell selectability

Rows can be styled to suggest their selectability (single or multiple) using the vclRowSelectability modifier which makes rows show a pointer cursor on hover.

Row and cell selection

Individual cells and thus rows can be visually selected using the vclSelected class.

Row hover highlighting

If a table row should be highlighted on hover, the vclRowHoverHighlight modifier class can be used. This hovering's intention is just for the sake of readability and should not indicate an action.

Disabled rows

Rows can be visually disabled with the vclDisabled modifier.

Alternating row color

Optionally an alternating row color can be defined by using the modifier vclAltRowColor.

Border configuration

The cell borders are removed with vclNoBorder. The border style can be changed from solid to dotted by using the vclDottedBorder modifier.

Padding style

If the default cell padding is too extensive, vclCondensed makes it more compact.

Borders style

By default, only horizontal borders are shown. For vertical borders, use the vclVerticalBorder modifier.

Text alignment

Left alignment is default, for centered text use class vclAlignCentered and for right aligned text vclAlignRight on tds.

Vertical alignment

Top alignment is default, for vertically centered content use class vclVAlignMiddle and for bottom aligned content vclVAlignBottom on a table or tds.

Pagination

The pagination component can be combined with the table.

Layout

The auto layout mode is used by default. For tables with toolbars however, the vclFixed class must be used to enable the fixed table layout mode.

Truncation

In conjunction with the fixed layout mode, the modifier vclNoWrap can be used to truncate all cell content which would span more than one line and show an ellipsis to indicate truncated content instead.

Individual cells can also be truncated using the general vclNoWrap and vclOverflowEllipsis modifiers from the utils module.

Wrapping behavior

To allow breaking words of textual cell content apart, use the modifier vclBreakWords. This works best in combination with the fixed layout mode.

Usage

basic example

With only examples it is impossible to show all possible permutation of modifiers.

Classes

  • vclTable

Modifiers

Table

  • vclCellHighlight
  • vclRowSelectability
  • vclRowHoverHighlight
  • vclNoBorder
  • vclCondensed
  • vclAltRowColor
  • vclAlignCentered
  • vclAlignRight
  • vclVAlignMiddle
  • vclVAlignBottom
  • vclNoWrap

Row

  • vclNoWrap (from utils)
  • vclOverflowEllipsis (from utils)
  • vclSelected
  • vclDisabled

Cell

  • vclSortableCol
  • vclSortAsc
  • vclSortDesc
  • vclSelected
  • vclNoWrap (from utils)
  • vclOverflowEllipsis (from utils)
  • vclDisabled

Variables

  • --table-color
  • --table-disabled-color
  • --table-border-color
  • --table-bg-color
  • --table-header-bg-color
  • --table-header-color
  • --table-header-button-hover-color
  • --table-footer-bg-color
  • --table-footer-color
  • --table-alt-bg-color
  • --table-highlight-bg-color
  • --table-highlight-hover-bg-color
  • --table-row-selected-color
  • --table-row-selected-bg-color

Demo

example.html on GH-pages.