{"id":13449847,"url":"https://github.com/whatever-company/slate-tables","last_synced_at":"2026-02-13T13:01:10.817Z","repository":{"id":40246540,"uuid":"233550520","full_name":"whatever-company/slate-tables","owner":"whatever-company","description":"Slate.js plugin for table edition","archived":false,"fork":false,"pushed_at":"2023-10-06T22:54:54.000Z","size":3320,"stargazers_count":25,"open_issues_count":20,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-28T16:45:33.275Z","etag":null,"topics":["reactjs","slate-plugin","slatejs"],"latest_commit_sha":null,"homepage":"https://whatever-company.github.io/slate-tables","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whatever-company.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-01-13T08:47:32.000Z","updated_at":"2024-09-17T23:59:06.000Z","dependencies_parsed_at":"2024-01-16T03:45:55.754Z","dependency_job_id":"ebbc0bd7-0259-40c4-9ea4-b71a1b5f65a3","html_url":"https://github.com/whatever-company/slate-tables","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whatever-company%2Fslate-tables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whatever-company%2Fslate-tables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whatever-company%2Fslate-tables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whatever-company%2Fslate-tables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whatever-company","download_url":"https://codeload.github.com/whatever-company/slate-tables/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245036111,"owners_count":20550661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["reactjs","slate-plugin","slatejs"],"created_at":"2024-07-31T06:00:58.333Z","updated_at":"2026-02-13T13:01:05.763Z","avatar_url":"https://github.com/whatever-company.png","language":"JavaScript","funding_links":[],"categories":["Running the update"],"sub_categories":["By Popularity"],"readme":"# slate-tables\n\nA Slate plugin to handle table edition.\n\nDemo: [https://whatever-company.github.io/slate-tables/](https://whatever-company.github.io/slate-tables)\n\n![Build Status](https://github.com/whatever-company/slate-tables/workflows/CI/badge.svg)\n\n## Install\n\n```bash\n$ npm login --registry=https://npm.pkg.github.com --scope=@whatever-company\n\u003e Username: USERNAME\n\u003e Password: TOKEN (from your github settings)\n\u003e Email: PUBLIC-EMAIL-ADDRESS\n$ npm install @whatever-company/slate-tables\n```\n\n## Features\n\n- Pressing \u003ckbd\u003eUp\u003c/kbd\u003e/\u003ckbd\u003eDown\u003c/kbd\u003e moves the cursor to the row above/below\n- Pressing \u003ckbd\u003eLeft\u003c/kbd\u003e/\u003ckbd\u003eRight\u003c/kbd\u003e moves the cursor to the cell before/after\n- Pressing \u003ckbd\u003eEnter\u003c/kbd\u003e inserts a new row (if enabled)\n- Pressing \u003ckbd\u003eTab\u003c/kbd\u003e moves the cursor to the next cell and creats a new row\n- Pressing \u003ckbd\u003eShift+Tab\u003c/kdb\u003e moves the cursor to the previous cell\n\n### Nested tables\n\nThe plugin supports nested tables natively.\n\n### colspan \u0026 rowspan\n\nColspan and Rowspan are supported. All operations create a matrix containing all cells' positions.\n\n### Copy/Paste behavior\n\nNothing is done to support copy/paste in this plugin. You have to implement it in you codebase.\n\n## Simple Usage\n\n```js\nimport TablePlugin from '@eliumhq/slate-tables'\n\nconst tablePlugin = TablePlugin({\n\tsaveColumns: false,\n\tenterCreatesRow: true,\n\tblocks: {\n\t\ttable: 'table',\n\t\trow: 'table-row',\n\t\tcell: 'table-cell',\n\t\tcontent: 'paragraph'\n\t}\n})\n\nconst plugins = [tablePlugin]\n```\n\n## Data structure\n\nHere is what your Slate document containing tables should look like:\n\n```jsx\n\u003cvalue\u003e\n\t\u003cdocument\u003e\n\t\t\u003cparagraph\u003eSome text\u003c/paragraph\u003e\n\n\t\t\u003ctable\u003e\n\t\t\t\u003ctable-row\u003e\n\t\t\t\t\u003ctable-cell colspan=\"2\"\u003e\n\t\t\t\t\t\u003cparagraph\u003eAny block can goes into cells\u003c/paragraph\u003e\n\t\t\t\t\u003c/table-cell\u003e\n\t\t\t\u003c/table-row\u003e\n\n\t\t\t\u003ctable-row\u003e\n\t\t\t\t\u003ctable-cell\u003e\n\t\t\t\t\t\u003cparagraph\u003eSecond row\u003c/paragraph\u003e\n\t\t\t\t\u003c/table-cell\u003e\n\n\t\t\t\t\u003ctable-cell\u003e\n\t\t\t\t\t\u003cparagraph\u003eSecond row\u003c/paragraph\u003e\n\t\t\t\t\u003c/table-cell\u003e\n\t\t\t\u003c/table-row\u003e\n\t\t\u003c/table\u003e\n\t\u003c/document\u003e\n\u003c/value\u003e\n```\n\n## `Options`\n\nOption object you can pass to the plugin.\n\n| prop              | type    | default    | desc                                                                                                                         |\n| ----------------- | ------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------- |\n| saveColumns       | boolean | false      | when enabled, it will save the columns in an array of object in the table node's data (useful to render a `\u003ccolgroup/\u003e` tag) |\n| enterCreatesRow   | boolean | false      | Add the support of the creation of a new row when user press `enter`                                                         |\n| blocks -\u003e table   | string  | table      | Node name for the `\u003ctable /\u003e`                                                                                                |\n| blocks -\u003e row     | string  | table-row  | Node name for the `\u003ctr /\u003e`                                                                                                   |\n| blocks -\u003e cell    | string  | table-cell | Node name for the `\u003ctd /\u003e`                                                                                                   |\n| blocks -\u003e content | string  | paragraph  | Node name for the default child of a cell                                                                                    |\n\n## `TablePlugin`\n\n### `TablePlugin(options: Options) =\u003e Instance`\n\nConstructs an instance of the table plugin, for the given options. You can then add this instance to the list of plugins passed to Slate.\n\n## Commands\n\n### `editor.insertTable()`\n\nCreates a table at current selection.\n\n### `editor.insertTableAtRange(range: Range)`\n\nCreates a table at the given range.\n\n### `editor.insertRow()`\n\nCreates a row at the current start block.\n\n### `editor.insertRowAtKey(key: string, atIndex: number)`\n\nCreates a row after the focused one inside the table at `key`. If `atIndex` is given, it will insert the new row at this index.\n\n### `editor.insertRowAtEnd()`\n\nCreates a row at the end of the focused table (start of the selection must be in a table)\n\n### `editor.insertColumn()`\n\nCreates a column after the focused one. This will alter all row nodes to add a cell.\n\n### `editor.insertColumnAtKey(key: string)`\n\nCreates a column after the row found at `key`. This will alter all row nodes to add a cell.\n\n### `editor.deleteColumn()`\n\nDelete the focused column. This will alter all row nodes to remove a cell.\n\n### `editor.deleteColumnAtKey(key: string)`\n\nDelete the column at `key`. This will alter all row nodes to remove a cell.\n\n### `editor.deleteTable()`\n\nDeletes the focused table.\n\n### `editor.deleteTableAtKey(key: string)`\n\nDeletes the focused at `key`.\n\n### `editor.deleteRow()`\n\nDeletes focused row.\n\n### `editor.deleteRowAtKey(key: string)`\n\nDeletes the row at `key`.\n\n### `editor.deleteCellsContentAtRange(range: Range)`\n\nDeletes content in cells found in `range`. It's necessary to use this instead of `editor.deleteAtRange` to not delete row \u0026 cell nodes.\n\n### `editor.setCellProperties`\n\nMerges `properties` in focused cell's data.\n\n### `editor.setCellPropertiesAtKey(key: string, properties: Object)`\n\nMerges `properties` in cell's data.\n\n### `editor.setColumnProperties(properties: Object)`\n\nIt will merges `properties` with the current column's data (stored in `table.data.columns`)\n\n### `editor.setColumnPropertiesAtIndex(tableKey: string, index: number, properties: Object)`\n\nMerges column's data with `properties` at given `index`.\n\n### `editor.setTableProperties(properties: Object)`\n\nMerges `properties` with table's data at current selection.\n\n### `editor.setTablePropertiesAtKey(key: string, properties: Object)`\n\nMerges `properties` with table's data at `key`.\n\n### `editor.increaseRowspanAtKey`\n\nIncreases the rowspan of the cell at `key`.\n\n### `editor.increaseColspanAtKey`\n\nIncreases the colspan of the cell at `key`.\n\n### `editor.decreaseRowspanAtKey`\n\nDecreases the rowspan of the cel at `key`.\n\n### `editor.decreaseColspanAtKey`\n\nDecreases the colspan of the cel at `key`.\n\n## Queries\n\n### `editor.isInTable()`\n\nReturns true if `selection.start` or `selection.end` is in a table node.\n\n### `editor.isRangeInTable(range: Range)`\n\nReturns true if `range.start` or `range.end` is in a table node.\n\n### `editor.getTableAtKey(key: string)`\n\nReturns a `Table` object for the table at `key`. This object contains helpers to access sibling cells, rows, columns.\n\n### `editor.getCellAtKey(key: string)`\n\nReturns the cell at `key`.\n\n### `editor.getRowAtKey(key: string)`\n\nReturns the row at `key`.\n\n### `editor.canIncreaseColspanAtKey(key: string)`\n\nReturns true if the cell at `key` can have a colspan increased by one.\n\n### `editor.canIncreaseRowspanAtKey(key: string)`\n\nReturns true if the cell at `key` can have a rowspan increased by one.\n\n### `editor.canDecreaseColspanAtKey(key: string)`\n\nReturns true if the cell at `key` can have a colspan decreased by one.\n\n### `editor.canDecreaseRowspanAtKey(key: string)`\n\nReturns true if the cell at `key` can have a rowspan decreased by one.\n\n### `editor.getColumnPropertiesAtKey(key: string)`\n\nReturns properties of the table at `key`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhatever-company%2Fslate-tables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhatever-company%2Fslate-tables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhatever-company%2Fslate-tables/lists"}