# editorjs-table

> Table for Editor.js with configurable rows and columns

Latest version **1.4.10** (published 2021-03-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install editorjs-table
pnpm add editorjs-table
yarn add editorjs-table
bun add editorjs-table
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.10 |
| Published | 2021-03-16 |
| First published | 2020-11-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 112.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 47 |
| Author | Arwaz Jamal |
| Maintainers | arwazjamal |
| Keywords | codex, codex-editor, table, editor.js, editorjs |

## Links

- npm: https://www.npmjs.com/package/editorjs-table
- Repository: https://github.com/4rw44z/editorjs-table
- Homepage: https://github.com/4rw44z/editorjs-table#readme
- Issues: https://github.com/4rw44z/editorjs-table/issues
- npm.io page: https://npm.io/package/editorjs-table

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.4.10 (latest) — 2021-03-16
- 1.4.9 — 2021-01-19
- 1.4.8 — 2021-01-19
- 1.4.7 — 2020-12-03
- 1.4.6 — 2020-12-02
- 1.4.5 — 2020-12-02
- 1.4.4 — 2020-11-24
- 1.4.3 — 2020-11-19
- 1.4.2 — 2020-11-18
- 1.4.1 — 2020-11-09
- 1.4.0 — 2020-11-09

## README

![](https://badgen.net/badge/Editor.js/v2.0/blue)

# Table tool
Table Block for the [Editor.js](https://editorjs.io).

![](screenshot.png)

## Installation

### Install via NPM or Yarn

Get the package

```shell
npm i --save-dev editorjs-table
```
or
```shell
yarn add editorjs-table --dev
```

Include module in your application

```javascript
const Table = require('editorjs-table');
```

### Upload to your project's source dir
1. Download folder `dist` from repository
2. Add `dist/bundle.js` file to your page.

## Usage
Add a new Tool to the `tools` property of the Editor.js initial config.

```javascript
var editor = EditorJS({
  ...
  
  tools: {
    ...
    table: {
      class: Table,
    }
  }
  
  ...
});
```

Or init Table Tool with additional settings

```javascript
var editor = EditorJS({
  ...
  
  tools: {
    ...
    table: {
      class: Table,
      inlineToolbar: true,
      config: {
        rows: 2,
        cols: 3,
      },
    },
  },
  
  ...
});
```

## Config Params

| Field              | Type     | Description                              |
| ------------------ | -------- | ---------------------------------------- |
| rows               | `number` | initial number of rows. by default `2`   |
| cols               | `number` | initial number of columns. by default `2`|

## Output data
This Tool returns `data` with following format

| Field     | Type         | Description                               |
| --------- | ------------ | ----------------------------------------- |
| content   | `string[][]` | two-dimensional array with table contents |

```json
{
    "type" : "table",
    "data" : {
        "content" : [ ["Kine", "1 pcs", "100$"], ["Pigs", "3 pcs", "200$"], ["Chickens", "12 pcs", "150$"] ]
    }
}
```

---
_Source: https://npm.io/package/editorjs-table · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
