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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ecl/generic-component-table

v1.5.0

Published

ECL Tables

Readme

Table responsive

Why and how to use this component

Tables show data sets organized in columns and rows.

When to use this component

  • when there is a need to show tables that will be displayed across different devices.
  • when you want to compare one set of values with another.
  • when you want to show how various parts comprise the whole.
  • when you want to understand trends over time for variable(s).
  • when you want to see which values deviate from the norm.
  • when you want to establish (or show) relationship between 2 (or more) variables.

Structure

Headers

In-page data tables always contain a header row, a header column or both, that lists column titles. (required)

Web writing guidelines

  • row/column titles should be kept short and clear.
  • table headers should never be empty. This is particularly of concern for the top-left cell of some tables.

Accessibility guidelines

  • the scope attribute identifies whether a table header is a column header or a row header.
  • the thread element defines the header rows for tables.

Rows and columns

The sets of raw data are displayed in rows below the header row.

If there are 5 rows or more, the rows have alternating colours (zebra stripes).

Do not use this component

  • don't use data tables to structure content that isn't part of a data set

Technical information

Tables have a default responsive behaviour which can be progressively enhanced with JavaScript. This dynamic behaviour organizes the tables' elements in a more accessible way on small screens.

More specifically, content editors can include the ecl-table--responsive class next to the root ecl-table when creating tables from WYSIWYG. This class is a flag for JavaScript behaviours to add improvements in mobile.

The JavaScript enhancements are added manually, only when necessary and when the structure of tables allow correct functioning of the JavaScript.

For example, an enhancement could be expressed in the following. Given the following table.

<thead>
  <tr>
    <th scope="col">Name</th>
    <th scope="col">Registration date</th>
    <th scope="col">Email</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td data-th="Name">John Doe</td>
    <td data-th="Registration date">01/01/2016</td>
    <td data-th="Email"><a href="mailto:[email protected]">[email protected]</a></td>
  </tr>
  <tr>
    <td data-th="Name">Jane Doe</td>
    <td data-th="Registration date">06/12/2016</td>
    <td data-th="Email"><a href="mailto:[email protected]">[email protected]</a></td>
  </tr>
  <tr>
    <td data-th="Name">Jack Doe</td>
    <td data-th="Registration date">03/05/2017</td>
    <td data-th="Email"><a href="mailto:[email protected]">[email protected]</a></td>
  </tr>
</tbody>

When the table is in a small viewport (mobile view), the information about Name of thead > tr > th should be added visually to the tbody > tr > td. The JavaScript behaviour is only responsible for binding these sets of information.

JavaScript behaviour is not responsible for any other visual, cosmetic or generally styling modifications. Responsive behaviour is handled by CSS.

Adding JavaScript behaviours

When using ECL tables, make sure to call the related JavaScript function:

ECL.eclTables();

You can also apply this script on a subset of elements:

ECL.eclTables(elements);

Implementation goals

JavaScript behaviours are meant to be attached manually, in special cases, with conscious choice that information should be displayed correctly after default responsive layout in exceptional user scenarios.

By default, tables should be displayed well only with CSS. Use JavaScript with caution, especially in the administration pages of your CMS.