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

@domternal/extension-table

v1.1.1

Published

Table extension for Domternal editor

Downloads

1,919

Readme

@domternal/extension-table

Version MIT License

Full-featured tables for the Domternal editor, built on prosemirror-tables.

Provides the Table, TableRow, TableCell, and TableHeader nodes with cell merge/split, three column-resize modes, header row/column toggles, cell selection, and Tab/arrow keyboard navigation. Drag-to-resize comes from the extension's plugins and is always on; the built-in TableView adds the row and column handles and the cell toolbar on top of it, and can be turned off (View: null) when you want to drive that UI yourself.

Links

Website    •    Documentation    •    Live examples

Install

pnpm add @domternal/extension-table

@domternal/core and @domternal/pm are peer dependencies and are already present in any Domternal editor setup.

Version 1.1.1 requires both @domternal/core and @domternal/pm in the range >=1.1.0 <2.0.0. Upgrade these packages together with this extension.

Usage

Add the Table extension to your editor. It pulls in TableRow, TableCell, TableHeader, and Gapcursor automatically, so a single import is enough.

import { Editor, Document, Paragraph, Text } from '@domternal/core';
import { Table } from '@domternal/extension-table';
import '@domternal/theme';

const editor = new Editor({
  extensions: [Document, Paragraph, Text, Table],
});

// Insert a 3x3 table with a header row, then add a row and merge selected cells.
editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run();
editor.commands.addRowAfter();
editor.commands.mergeCells();

Configure resize and rendering behavior through Table.configure:

Table.configure({
  resizeBehavior: 'neighbor', // 'neighbor' | 'independent' | 'redistribute'
  constrainToContainer: true,
  cellMinWidth: 25,
  defaultCellMinWidth: 100,
  allowTableNodeSelection: false, // allow selecting the whole table as a node
  HTMLAttributes: {}, // custom attributes on the rendered <table>
  // View: null, // the default is the built-in TableView; set null to supply your own UI
});

With constrainToContainer on (the default), last-column resize is capped at the container edge. Adding a column to a table with custom widths first uses available container space, then borrows only the required space from the closest columns, starting on the selected side. Other widths stay unchanged. The new column uses defaultCellMinWidth when possible; borrowing never shrinks a column below cellMinWidth. If even the minimum widths cannot fit, or the table already overflows, the wrapper scrolls horizontally instead of resetting the table's widths.

With the constraint off, adding a column preserves existing custom widths and grows the table by the new column's width. In either mode, a table with no stored widths keeps automatic layout and a floor of defaultCellMinWidth per column. Adding to a partially sized table first resolves the unspecified widths from its rendered columns. Insertion and width changes form one undoable operation, including in command chains.

Commands

Registered on the editor when the extension is active:

  • insertTable({ rows?, cols?, withHeaderRow? }), deleteTable
  • addRowBefore, addRowAfter, deleteRow
  • addColumnBefore, addColumnAfter, deleteColumn
  • toggleHeaderRow, toggleHeaderColumn, toggleHeaderCell
  • mergeCells, splitCell
  • setCellAttribute(name, value), setCellSelection({ anchorCell, headCell? })
  • goToNextCell, goToPreviousCell, fixTables

Cells carry colspan, rowspan, colwidth, background, textAlign, and verticalAlign. The last three are what the cell toolbar writes, and setCellAttribute('background', '#ffe0e0') or setCellAttribute('textAlign', 'center') sets them from code.

The package also exports the TableView node view, the createTable and deleteTableWhenAllCellsSelected helpers, and re-exports CellSelection and TableMap (which originate in prosemirror-tables) from @domternal/pm/tables, so you do not need a bare prosemirror-tables import.

Keyboard shortcuts

| Shortcut | Action | |---|---| | Tab | Move to the next cell, adding a row first when the cursor is in the last one | | Shift-Tab | Move to the previous cell | | Backspace, Delete, Mod-Backspace, Mod-Delete | Delete the table when all of its cells are selected |

Tab and Shift-Tab stand down inside a listItem or taskItem, so list indentation keeps them. Arrow keys move between cells, and Shift with them extends a cell selection; both come from prosemirror-tables, not this keymap.