# etable

> table plugin

Latest version **0.1.9** (published 2016-12-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install etable
pnpm add etable
yarn add etable
bun add etable
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.9 |
| Published | 2016-12-28 |
| First published | 2016-12-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Rhocutan |
| Maintainers | aketov |
| Keywords | table, plugin, jquery |

## Links

- npm: https://www.npmjs.com/package/etable
- Repository: https://github.com/Rhocutan/etable
- Homepage: https://github.com/Rhocutan/etable#readme
- Issues: https://github.com/Rhocutan/etable/issues
- npm.io page: https://npm.io/package/etable

## Dependencies (1)

- [jquery](https://npm.io/package/jquery.md) ^3.1.1

## 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

- 0.1.9 (latest) — 2016-12-28
- 0.1.7 — 2016-12-28
- 0.1.5 — 2016-12-27

## README

# etable
This is a beta version, sorry guys

**etable** is a plugin which can help you work with a table on a HTML page

**Getting started**

_npm install etable --save_

    new Etable(tag_id, options)

tag_id - reference to your tag

options - an object of settings 

    import 'etable';
    var e = new Etable('myDiv', {
                          head: [
                            "Number",
                            'Name',
                            'Type'
                          ],
                          colWidth: [70, 100, 70],
                          "data": [
                            [1, 'TV', 'new'],
                            [2, 'PC', 'used'],
                            [3, 'Mac', 'new'],
                            [4, 'Mac', 'used'],
                            [5, 'Mac', 'new'],
                            [6, 'Mac', 'used'],
                            [7, 'Mac', 'used'],
                            [8, 'Mac', 'new'],
                          ]
                        })
                        
***Search***

    e.find('Mac')
    
***Sorting***

    new Etable("tb", {
         isSort: true,
         head: [
           "Number",
           'Name',
           'Type'
         ],
         colWidth: [70, 100, 70],
         "data": [
           [1, 'TV', 'new'],
           [2, 'PC', 'used'],
           [3, 'Mac', 'new'],
           [4, 'Mac', 'used'],
           [5, 'Mac', 'new'],
           [6, 'Mac', 'used'],
           [7, 'Mac', 'used'],
           [8, 'Mac', 'new'],
         ]
       })
       
***Custom style of a cell***

options has a property _cellRender_. It's a function which provides rendering of a cell

    cellRender: function (td, value) {
                var color = "black";
                if (value === "new") {
                  color = "#00bd33"
                } else if (value === "used") {
                  color = "blue"
                } else if (value === "old") {
                  color = "gray"
                }
                td.css({color: color, "fontWeight": "bold"})
    
                if (value === "PC") {
                  td.css({background: "#00b8ff top right no-repeat"})
                }
            }
            
***Editable cell***
          
Property editable for a cell

    {
        value: "new",
        editable: true
    }
    
Example

    new Etable("tb", {
          isSort: true,
          head: [
            "Number",
            'Name',
            'Type'
          ],
          onChange: function (event, etable, td, oldValue, newValue) {
            console.log("old value was %s , new value is %s", oldValue, newValue)
          },
          colWidth: [70, 100, 70],
          "data": [
            [1, 'TV', {
              value: "new",
              editable: true
            }],
            [2, 'PC', 'used'],
            [3, 'Mac', 'new'],
            [4, 'Mac', 'used'],
            [5, 'Mac', 'new'],
            [6, 'Mac', 'used'],
            [7, 'Mac', 'used'],
            [8, 'Mac', 'new'],
          ]
        })
        
Special property onChange is a function which will be invoked when data has been changed

    onChange: function (event, etable, td, oldValue, newValue)

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