New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@lexical/table

Package Overview
Dependencies
Maintainers
5
Versions
282
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/table

This package provides the Table feature for Lexical.

  • 0.24.1-nightly.20250218.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
547K
decreased by-21.18%
Maintainers
5
Weekly downloads
 
Created
Source

@lexical/table

See API Documentation

This package contains the functionality for the Tables feature of Lexical.

Lexical Table Plugin

A plugin for handling tables in Lexical.

Installation

npm install @lexical/table

Usage

import {TablePlugin} from '@lexical/table';

// In your editor
const editor = createEditor({
  // ...other config
  nodes: [...TablePlugin.nodes],
});

// In your React component
function MyEditor() {
  return (
    <LexicalComposer>
      <div className="editor-container">
        <PlainTextPlugin />
        <TablePlugin />
      </div>
    </LexicalComposer>
  );
}

Features

Tables

  • Create and edit tables with customizable rows and columns
  • Support for table headers
  • Cell selection and navigation
  • Copy and paste support

Limitations

Nested Tables

Nested tables (tables within table cells) are not supported in the editor. The following behaviors are enforced:

  1. When attempting to paste a table inside an existing table cell, the paste operation is blocked.
  2. The editor actively prevents the creation of nested tables through the UI or programmatically.

Note: When pasting HTML content with nested tables, the nested content will be removed by default. Make sure to implement appropriate importDOM handling if you need to preserve this content in some form.

This approach allows you to:

  1. Detect nested tables in the imported HTML
  2. Extract their content before it gets removed
  3. Preserve the content in a format that works for your use case

Choose an approach that best fits your needs:

  • Flatten nested tables into a single table
  • Convert nested tables to a different format (e.g., lists or paragraphs)
  • Store nested content as metadata for future processing

Keywords

FAQs

Package last updated on 18 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc