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 🙏

© 2026 – Pkg Stats / Ryan Hefner

js-table-builder

v1.4.1

Published

A versatile and highly customizable JavaScript library to build dynamic HTML tables from JSON data.

Downloads

81

Readme

jsTableBuilder

A versatile and highly customizable JavaScript library to build dynamic HTML tables from JSON data.

Features

  • Dynamic column generation based on JSON configuration
  • Built-in search/filtering functionality
  • Customizable table appearance (borders, widths, etc.)
  • Auto-generated serial numbers
  • Optional footer row

Links

Installation via NPM

npm install js-table-builder

Scaffold CLI Usage (shadcn-like)

You can use npx to paste the raw source files directly into your project! This will create a buildTable folder in your current directory, allowing you to completely customize the internal components of jsTableBuilder.

npx js-table-builder

Usage via CDN

You can quickly get started by including jsTableBuilder directly in your HTML using our CDN link:

<script src="https://keshavsoft.github.io/jsTableBuilder/dist/v2/tableBuilder.umd.cjs"></script>

Quick Start Example

Here is a full example demonstrating how to fetch your data and columns configuration, initialize jsTableBuilder, and render the table into a DOM element.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jsTableBuilder Example</title>
</head>
<body>
    <!-- The container where the table will be rendered -->
    <div id="table-root"></div>

    <!-- Include jsTableBuilder -->
    <script src="https://keshavsoft.github.io/jsTableBuilder/dist/v2/tableBuilder.umd.cjs"></script>

    <script>
        async function init() {
            try {
                // 1. Fetch the data and column configurations
                const [dataResponse, columnsResponse] = await Promise.all([
                    fetch("./all.json"),
                    fetch("./columns.json")
                ]);

                if (!dataResponse.ok) throw new Error("Failed to fetch data");
                if (!columnsResponse.ok) throw new Error("Failed to fetch columns");

                const tableData = await dataResponse.json();
                const columnsData = await columnsResponse.json();

                // 2. Define the table configuration
                const config = {
                    htmlId: "table-root", // ID of the container element
                    data: tableData,
                    columns: columnsData,
                    tableOptions: {
                        commonOptions: {
                            tableWidth: "100%", 
                            tableBorder: "0px",
                            showSerialNo: true // Automatically adds a # column
                        },
                        footOptions: {
                            showFooter: true
                        }
                    },
                    topHeader: {
                        label: "My Beautiful Table",
                        placeholder: "Search anything..." // Enables the global search bar
                    }
                };

                // 3. Initialize and render the table
                const tableBuilder = new window.ks.TableBuilder(config);
                tableBuilder.appendToDom();

            } catch (error) {
                console.error("Error initializing table:", error);
            }
        }

        // Run the init function
        init();
    </script>
</body>
</html>

Configuration Details

The config object passed to new window.ks.TableBuilder(config) accepts the following properties:

  • htmlId (String): The ID of the HTML element where the table will be injected.
  • data (Array): An array of objects representing the rows of the table.
  • columns (Array): An array of column configuration objects.
  • tableOptions (Object): Customization options for the table appearance and behavior.
    • commonOptions.tableWidth: Set the CSS width of the table (e.g., "800px", "100%").
    • commonOptions.tableBorder: Set the CSS border for the table.
    • commonOptions.showSerialNo: Boolean to enable an auto-incrementing serial number column.
    • footOptions.showFooter: Boolean to display a table footer.
  • topHeader (Object): Configuration for the header area above the table.
    • label: A title to display above the table.
    • placeholder: Placeholder text for the search input field.