0.1.0 • Published 4 years ago

slate-ng-element-table v0.1.0

Weekly downloads
-
License
-
Repository
-
Last release
4 years ago

SlateNgElementTable

Quick start

Use with slate-ng

 /// module.ts
 import {NsElementTableModule} from 'slate-ng-element-table';

 /// component.ts
 // registry element
 this.registryNsElement.add([
      SlateNgElementTable,
      SlateNgElementTableCell,
      SlateNgElementTableRow,
 ]);
 
 // use withTables
 editor = withTables(withAngular(createEditor()));

 
 // value
 {
      type: 'table',
      children: [
        {
          type: 'table-row',
          children: [
            {
              type: 'table-cell',
              children: [{text: ''}]
            },
            {
              type: 'table-cell',
              children: [{text: 'Human', bold: true}]
            },
            {
              type: 'table-cell',
              children: [{text: 'Dog', bold: true}]
            },
            {
              type: 'table-cell',
              children: [{text: 'Cat', bold: true}]
            }
          ]
        },
        {
          type: 'table-row',
          children: [
            {
              type: 'table-cell',
              children: [{text: '# of Feet', bold: true}]
            },
            {
              type: 'table-cell',
              children: [{text: '2'}]
            },
            {
              type: 'table-cell',
              children: [{text: '4'}]
            },
            {
              type: 'table-cell',
              children: [{text: '4'}]
            }
          ]
        },
        {
          type: 'table-row',
          children: [
            {
              type: 'table-cell',
              children: [{text: '# of Lives', bold: true}]
            },
            {
              type: 'table-cell',
              children: [{text: '1'}]
            },
            {
              type: 'table-cell',
              children: [{text: '1'}]
            },
            {
              type: 'table-cell',
              children: [{text: '9'}]
            }
          ]
        }
      ]
  }
 
  // import css
  @import "~slate-ng-element-table/table.css";
0.1.0

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago