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

@matthewkennedy/gridtable.css

v1.0.1

Published

GridTable.css provides a simple way to create HTML tables using custom DOM elements backed by the power of CSS Grid.

Downloads

4

Readme

GridTable.css

GridTable.css allows you to easily build responsive tables based on CSS Grid, all while bypassing the quirky table behaviors everybody hates.

Overview

  • Allows you to set <a href="some/link">Some Content</a> as a table cell for better links.
  • Wrap table rows with Rails / Hotwire tags without problems.
  • Uses custom HTML DOM elements to cut down on css class stuffing.

Installing

Add the tiny css file to your project or yarn add gridtable.css then import the css into your project.

Usage

Create a table layout using the custom DOM elements provided, Notice that you can use <a> tags as table cells giving a clickable cell without any of the quirky behavior you get with a standard <table>.

You can add the layout styling style="grid-template-columns: 1fr 1fr 1fr 1fr;" to the <g-table> element and it will be inherited by all table rows, alternatively you can specify different layouts for the head and body by adding the styling to the <g-thead> or <g-tbody> as needed. If required you can also add the styling directly to a row to enforce a row specific design.

See example below and more in the index.html file.

<g-responsive> <!-- Wrap the table in the responsive tag -->

           <!--
           IMPORTANT: Set the cell format using CSS Grid Template Columns.
                      You can set this on the <g-table> tag, and it will be
                      inherited through the <g-head> and <g-body> rows. Alternatively
                      you can set this independently on the <g-thead> and <g-tbody> -->
  <g-table style="grid-template-columns: 1fr 1fr 1fr 1fr;">
    <g-thead>
      <g-tr>
        <g-th>Product</g-th>
        <g-th>Price</g-th>

              <!--
              NOTE: You can override the grid-column-template
                    telling a cell to span 2 columns -->
        <g-th style="grid-column: span 2;">State</g-th>
      </g-tr>
    </g-thead>
    <g-tbody>
      <g-tr>
        <g-td>Adidas FCraft</g-td>
        <g-td>$99.99</g-td>
        <g-td>Available</g-td>
        <g-td>Delete</g-td>
      </g-tr>

      <g-tr>
        <g-td>Adidas Ultra4D</g-td>
        <g-td>$199.99</g-td>
        <g-td>Available</g-td>
        <g-td>Delete</g-td>
      </g-tr>

      <g-tr>
        <g-td>Adidas UltraBoost</g-td>
        <g-td>$201.99</g-td>
        <g-td>Available</g-td>

        <!--
        NOTE: You can use <a> tags as table cells -->
        <a href="product/3/delete">Delete</a>
      </g-tr>

      <!--
      NOTE: These next rows are loaded in later via a turbo frame,
            and the table cell formatting is carried through fine. -->
      <turbo-frame id="some_id_1">
        <g-tr>
          <g-td>Nike Air</g-td>
          <g-td>$99.99</g-td>
          <g-td>Available</g-td>
          <g-td>Delete</g-td>
        </g-tr>

        <g-tr>
          <g-td>Nike Zoom</g-td>
          <g-td>$199.99</g-td>
          <g-td>Available</g-td>
          <g-td>Delete</g-td>
        </g-tr>
      </turbo-frame>
    </g-tbody>
  </g-table>
</g-responsive>