# table-editor

> edit tabular data.

Latest version **2.1.0** (published 2015-04-05) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2015-04-05 |
| First published | 2014-05-29 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Maintainers | sethvincent |

## Links

- npm: https://www.npmjs.com/package/table-editor
- Repository: https://github.com/sethvincent/table-editor
- Issues: https://github.com/sethvincent/table-editor/issues
- npm.io page: https://npm.io/package/table-editor

## Dependencies (3)

- [ractive](https://npm.io/package/ractive.md) 0.6.1
- [remove-element](https://npm.io/package/remove-element.md) 0.0.0
- [ractive-decorators-sortable](https://npm.io/package/ractive-decorators-sortable.md) git://github.com/sethvincent/ractive-decorators-sortable

## Recent versions

- 2.1.0 (latest) — 2015-04-05
- 2.0.3 — 2015-02-18
- 2.0.2 — 2015-02-06
- 2.0.1 — 2015-02-06
- 2.0.0 — 2015-01-20
- 1.1.0 — 2015-01-20
- 1.0.1 — 2014-12-03
- 1.0.0 — 2014-12-03
- 0.7.5 — 2014-11-07
- 0.7.4 — 2014-11-07
- 0.7.3 — 2014-11-07
- 0.7.2 — 2014-11-07
- 0.7.1 — 2014-11-05
- 0.7.0 — 2014-11-05
- 0.6.0 — 2014-11-05
- … 20 more at https://npm.io/package/table-editor/versions

## README

# table-editor
> a module for creating a very simple editor for tabular data.

## Install

```
npm install --save table-editor
```

It's designed for use with browserify, but you can alternatively grab the `table-editor.js` file.

## Examples


### Simple example:

```js
var fs = require('fs');
var on = require('component-delegate').bind;
var TableEditor = require('table-editor');
var template = fs.readFileSync(__dirname + '/table.html', 'utf8');

var editor = new TableEditor({
  el: 'editor',
  template: template,
});

editor.import([
  { example: 'weeeee', wat: 'wooooo' },
  { example: 'weeeee', wat: 'wooooo' },
  { example: 'weeeee', wat: 'wooooo' }
]);

editor.on('change', function (change) {
  console.log(editor.data.rows);
});

on(document.body, '#add-row', 'click', function(e) {
  editor.addRow();
});

on(document.body, '#add-column', 'click', function(e) {
  var name = window.prompt('New column name');
  editor.addColumn({ name: name, type: 'string' });
});

```

Check out the rest of the above example, including an index.html file and the table.html template in the [`gh-pages` branch of this repo](https://github.com/sethvincent/table-editor/tree/gh-pages).

## Extended example

This module is being created specifically for this project: http://github.com/flatsheet/editor

Check out that repo for an extended example of table-editor usage, including an alternate table template and pretty much full usage of the table-editor API.

You can see the flatsheet example in action here: http://flatsheet.io/editor

## Contributing
Note: The table-editor.js file is bundled for each release. Edit the index.js file.

- Fork this repository
- Create your feature branch: `git checkout -b new-feature`
- Commit your changes: `git commit -m 'Add new feature'`
- Push to the branch: `git push origin new-feature`
- Submit a pull request via GitHub

## License
MIT

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