codex.editor.table

1.1.2 • Public • Published

Table tool

Table Block for the CodeX Editor.

Installation

Install via NPM or Yarn

Get the package

npm i --save-dev codex.editor.table

or

yarn add codex.editor.table --dev

Include module in your application

const Table = require('codex.editor.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 CodeX Editor initial config.

var editor = CodexEditor({
  ...
  
  tools: {
    ...
    table: {
      class: Table,
    }
  }
  
  ...
});

Or init Table Tool with additional settings

var editor = CodexEditor({
  ...
  
  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
{
    "type" : "table",
    "data" : {
        "content" : [ ["Kine", "1 pcs", "100$"], ["Pigs", "3 pcs", "200$"], ["Chickens", "12 pcs", "150$"] ]
    }
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.2
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.2
    1
  • 1.1.1
    0

Package Sidebar

Install

npm i codex.editor.table

Weekly Downloads

1

Version

1.1.2

License

MIT

Unpacked Size

22.5 kB

Total Files

4

Last publish

Collaborators

  • codex-team